-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bash: support -- delimeter #164
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #164 +/- ##
=======================================
Coverage 88.88% 88.88%
=======================================
Files 3 3
Lines 360 360
=======================================
Hits 320 320
Misses 40 40 ☔ View full report in Codecov by Sentry. |
/CC @usidedown does this work for you? pip install "git+https://github.com/iterative/shtab.git@double-dash#egg=shtab" |
e780830
to
2664271
Compare
2664271
to
3d583e0
Compare
Awesome, thanks for the quick response! I'm getting a slight weirdness. Here's my example: import argparse
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--opt1', choices=['a','b'])
parser.add_argument('pos1', type=int, choices=list(range(8)))
parser.add_argument('pos2', type=int, choices=list(range(4)))
parser.add_argument('pos3', type=int, choices=list(range(2)))
return parser
def main():
parser = get_parser()
print(parser.parse_args())
if __name__ == '__main__':
main() my completion commandline: eval "$(shtab src.test.get_parser --prog=foo --shell=bash)" If I do the regular foo 6 4 <tab> I get foo -- 6 4 <tab> I get |
3d583e0
to
b032228
Compare
try now? |
Looks good! |
- fixes #163
diff
sans whitespace