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

Generate zsh completion script automatically #504

Closed
wants to merge 1 commit into from

Conversation

Freed-Wu
Copy link

@Freed-Wu Freed-Wu commented Aug 12, 2022

Fix #503

Modified from https://github.com/ytdl-org/youtube-dl/tree/master/devscripts

/usr/share/zsh/site-functions/_ptpython

#compdef ptpython ptipython

_arguments -s -S \
  '(- *)'{-h,--help}'[show this help message and exit]:str' \
  --vi'[Enable Vi key bindings]' \
  {-i,--interactive}'[Start interactive shell after executing this file.]' \
  --light-bg'[Run on a light background (use dark colors for text).]' \
  --dark-bg'[Run on a dark background (use light colors for text).]' \
  --config-file'[Location of configuration file.]:file:_files' \
  --history-file'[Location of history file.]:file:_files' \
  '(- *)'{-V,--version}'[show program'\''s version number and exit]:str' \
  '*:args:_files'
❯ ptpython -<Tab>
option
--config-file    Location of configuration file.
--dark-bg        Run on a dark background (use light colors for text).
--help           show this help message and exit
--history-file   Location of history file.
-h               show this help message and exit
--interactive    Start interactive shell after executing this file.
-i               Start interactive shell after executing this file.
--light-bg       Run on a light background (use dark colors for text).
--version        show program's version number and exit
--vi             Enable Vi key bindings
-V               show program's version number and exit
❯ ptpython --config-file <Tab>
file
CHANGELOG       examples/       MANIFEST.in     ptpython/       README.rst      setup.cfg       tests/
docs/           LICENSE         mypy.ini        pyproject.toml  scripts/        setup.py

@Freed-Wu Freed-Wu force-pushed the master branch 7 times, most recently from 31bcef2 to fa04c16 Compare August 24, 2022 18:38
Modified from <https://github.com/ytdl-org/youtube-dl/tree/master/devscripts>

1. `scripts/zsh_completion.py`
2. `sudo mv _* /usr/share/zsh/site-functions`
3. `compinit`
@Freed-Wu
Copy link
Author

#509

@Freed-Wu Freed-Wu closed this Aug 28, 2022
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

Successfully merging this pull request may close these issues.

[feature] shell completion
1 participant