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

shtab generates invalid shell output from Python files that have an explicit py extension #20

Closed
mpkocher opened this issue Aug 12, 2020 · 0 comments · Fixed by #21
Closed
Assignees
Labels
enhancement New feature or request p0-critical Max priority (ASAP)

Comments

@mpkocher
Copy link

Using shtab 1.3.0, the autocomplete output generated from python files with an explicit .py extension and/or with a '-' in the file name will create invalid code.

For example, using zsh and my_example.py will generate invalid code.

The code generated looks like this.

_shtab_my_example.py_options_=(
  "(- :)"{-h,--help}"[show this help message and exit]"
  "--input-file[Path to file]:input_file:"
  "--max-records[Max Records to process]:max_records:"
  "--alpha[Level of alpha filtering to apply]:alpha:"
  "--print-completion[print shell completion script]:print_completion:(bash zsh)"
)

Using my-example.py will generate similar issues.

Specifically, the error look similar to this:

./my_example2.py --hel...        
_my_example2.py:5: unknown file attribute: \n
_my_example2.py:5: unknown file attribute: \n
_my_example2.py:5: unknown file attribute: \n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p0-critical Max priority (ASAP)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants