Message ID | 20240227-shell-completion-v1-1-a809aad38589@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [b4] b4: add shell completion via python-shtab | expand |
diff --git a/src/b4/command.py b/src/b4/command.py index be0f033..10cb4d0 100644 --- a/src/b4/command.py +++ b/src/b4/command.py @@ -363,6 +363,13 @@ def setup_parser() -> argparse.ArgumentParser: help='Submit the token received via verification email') sp_send.set_defaults(func=cmd_send) + try: + import shtab + + shtab.add_argument_to(parser, ["-s", "--print-completion"]) + except ImportError: + pass + return parser