-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
The module does not seem to fully honor mandatory backets (-option) and ignores commands therein.
Example code:
#!/usr/bin/env python
"""Demonstration of docopt_completion not honoring exclusives.
Usage:
exhon.py --help
exhon.py (-c cmd)
Options:
-h Print help
-c Indicats command mode
"""
from docopt import docopt
arguments = docopt(__doc__)
print argumentsExpected behavior in bash session:
confus@confusion:~/test$ exhon.py #[TAB]
-c --help
confus@confusion:~/test$ exhon.py -c #[TAB] completes to only allowed commad:
confus@confusion:~/test$ exhon.py -c cmd
Actual (wrong) behavior in bash session:
confus@confusion:~/test$ exhon.py #[TAB] gives wrong selection ("cmd" should not be there)
-c cmd --help
confus@confusion:~/test$ exhon.py -c #[TAB] gives no completion (should complete to "... -c cmd")
confus@confusion:~/test$ exhon.py -c
Arranging the usage string the other way around as in exhon.py (cmd -c) yields better but similarly wrong results:
confus@confusion:~/test$ exhon.py cmd#[TAB] completes as expected to:
confus@confusion:~/test$ exhon.py cmd -c#[TAB] but further tab repeats the option:
confus@confusion:~/test$ exhon.py cmd -c -c # again and again if [TAB] is pressed more often
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels