tldr-pages / tldr-python-client

Python command-line client for tldr pages

Home Page:https://pypi.org/project/tldr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto completion for fish

Zesko opened this issue · comments

commented

I create new autocompletion for fish shell.

complete -c tldr -s h -l help        -d "show this help message" -f
complete -c tldr -s v -l version     -d "show program's version number" -f
complete -c tldr -s u -l update      -d "Update the local cache of pages" -f
complete -c tldr -s p -l platform    -d "Override the operating system" -xa "linux osx sunos windows common"
complete -c tldr -s l -l list        -d "List all commands in the cache" -f
complete -c tldr -s s -l source      -d "Override the default page source" -r
complete -c tldr -s c -l color       -d "Override color stripping" -f
complete -c tldr -s r -l render      -d "Render local markdown files" -r
complete -c tldr -s l -l language    -d "Override the default language" -f
complete -c tldr -s m -l markdown    -d "Just print the plain page file" -f
complete -c tldr -l print-completion -d "Print shell completion script" -xa "bash zsh tcsh"

function __tldr_commands
    tldr --list | string replace -a -r "', '" "\n" | string replace -a -r "\['|'\]" ""
end

complete -f -c tldr -a "(__tldr_commands)"

Can you add it into /usr/share/fish/vendor_completions.d/tldr.fish ?

Thanks for providing this. I plan to add a link to the README to this issue so that people using fish can come here to get autocomplete, and tweak things over time. This isn't something I plan to formally support as I don't use fish and have no interest in trying to maintain this, especially given all our other completions are autogenerated. Ideally, someone would be able to work with our upstream provider, shtab, to provide support for fish there.