Created
January 28, 2017 06:30
-
-
Save garywu/6a7910e9d450acb006e71d24cc6f7a74 to your computer and use it in GitHub Desktop.
docopt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Naval Fate. | |
Usage: | |
naval_fate.py ship new <name>... | |
naval_fate.py ship <name> move <x> <y> [--speed=<kn>] | |
naval_fate.py ship shoot <x> <y> | |
naval_fate.py mine (set|remove) <x> <y> [--moored | --drifting] | |
naval_fate.py (-h | --help) | |
naval_fate.py --version | |
Options: | |
-h --help Show this screen. | |
--version Show version. | |
--speed=<kn> Speed in knots [default: 10]. | |
--moored Moored (anchored) mine. | |
--drifting Drifting mine. | |
""" | |
from docopt import docopt | |
if __name__ == '__main__': | |
arguments = docopt(__doc__, version='Naval Fate 2.0') | |
print(arguments) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment