-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add shell-completion for available function names #22
Comments
here is a sample completion function for bash #!/bin/bash
# bash completion for shell-functools
ft_functions="$(ft-functions | sed -E 's/�\[[0-9]+m//g' | cut -f1 -d' ')"
function _complete_ft() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-h --help -c --column"
if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
else
COMPREPLY=( $(compgen -W "${ft_functions}" -- ${cur}) )
return 0
fi
}
complete -F _complete_ft map
complete -F _complete_ft filter
complete -F _complete_ft foldl Install to Interesting project..., cheers! |
* see sharkdp#22 on sharkdp/shell-functools
@rpdeo Cool, thanks! We should probably add an option to |
You are welcome! I have not looked at the python code yet to fully understand the Command class, but am pretty sure it can be extended well with python modules like prompt_toolkit, cliff and click. If I come up with something along those lines that might be worth merging, will let you know. |
The text was updated successfully, but these errors were encountered: