shtab
shtab copied to clipboard
↔️ Automagic shell tab completion for Python CLI applications
Hey, thanks for creating this! I wanted to start using it in a CLI project of my own, but before adoption, I am facing a usability question, which I was...
https://github.com/iterative/shtab/blob/3d614484fbf664adc9b898b5f5f82a9b793482e3/README.rst?plain=1#L83 argcomplete supports bash and zsh these days, I suppose updating the item to refect that or removing it would be in order.
shtab looks like a nice thing that I want to add to my programs. But there's one big question: How can I use shtab, so It's useable for end users?...
It would be useful to have a way to explicitly include `.` as a completion option in a tool that takes a directory arg that's often the current directory, `.`....
Can it provide a function to generate code like ? TIA!
Such as ```python self.parser.add_argument( 'operation', choices=["get", "set", "del"], nargs="?", ) self.parser.add_argument( 'service', nargs="?", ) self.parser.add_argument( 'username', nargs="?", ) ``` will generate ```zsh _shtab_keyring_options=( "(- : *)"{-h,--help}"[show this help message and...
The following example comes from [/usr/share/zsh/functions/Completion/Unix/_sudo](https://github.com/zsh-users/zsh/blob/a9386df5581487e5e34ecb3ce422bacf62d10c3d/Completion/Unix/Command/_sudo#L61-L62) file `a`: ```python #!/usr/bin/env python from argparse import ArgumentParser import shtab parser = ArgumentParser() shtab.add_argument_to(parser) parser.add_argument("command", nargs=1).complete = {"zsh": "{_command_names -e}"} parser.add_argument("args", nargs="...").complete =...
dvc==2.31.0 shtab==1.5.6 I for example have `dvc stage add --name Test -d folder/file -w` and want to remove `folder/file` and replace it. Than `-w` is autocompleted (`dvc stage add --name...
updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) - [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.9.0...v1.10.0)