sphinx icon indicating copy to clipboard operation
sphinx copied to clipboard

Add shell completions by shtab

Open Freed-Wu opened this issue 3 years ago • 0 comments

Subject: Add shell completions by shtab

Feature or Bugfix

  • Feature

Install

cmds=(apidoc autogen build quickstart)
for cmd in $cmds; do
 sphinx-$cmd --print-completion bash | sudo tee /usr/share/bash-completion/completions/sphinx-$cmd
 sphinx-$cmd --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_sphinx-$cmd
 sphinx-$cmd --print-completion tcsh | sudo tee /etc/profile.d/sphinx-$cmd.completion.csh
done

Result

❯ sphinx-quickstart -<TAB>
option
-a                   author names
--author             author names
--batchfile          create batchfile
-d                   define a template variable
--dot                replacement for dot in _templates etc.
...
❯ sphinx-quickstart --templatedir <TAB>
templatedir
doc/     sphinx/  tests/   utils/

Freed-Wu avatar Sep 14 '22 18:09 Freed-Wu