-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Classical naval app is in my /usr/bin/naval file:
#!/usr/bin/python3
"""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)
Generate autocomletion for that via docopt-completion naval and have 2 bugs:
- commands completes with variety of files in current dir except naval commands. Looking in bashcompletion file gave me that:
COMPREPLY=( $( compgen -fW ' move shoot new' -- $cur) )
it should be just compgen -W, not -fW. f id sor files, i suppose.
- pressing tab after
naval mine set ..pressing tab..gives me nothing or filnames in current dir. But it should print me--moored --driftingand probably<x> <y>.
If i type naval mine set 10 10 ..press tab.. it gives me nothing neither.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels