Skip to content
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

Completion of environment variable names #172

Open
mauvilsa opened this issue Jun 19, 2024 · 0 comments
Open

Completion of environment variable names #172

mauvilsa opened this issue Jun 19, 2024 · 0 comments

Comments

@mauvilsa
Copy link

When working in shells it is common to store values in environment variables, and most commands allow tab completion of environment variable names, for example:

$ echo $BASH_V<TAB>
$ echo $BASH_VERSI<TAB><TAB>
$BASH_VERSINFO  $BASH_VERSION
$ echo $BASH_VERSIO<TAB>
$ echo $BASH_VERSION

Unfortunately, when an shtab completion script is activated, the completion of environment variable names doesn't work. For instance take the following script:

from argparse import ArgumentParser
import shtab

parser = ArgumentParser()
parser.add_argument("--pid", type=int)
shtab.add_argument_to(parser, "--shell-completion")
print(parser.parse_args())

The following doesn't complete anything:

$ cli.py --pid $BASHP<TAB><TAB>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant