Update '.general.rc'

This commit is contained in:
2023-05-25 12:46:32 +02:00
parent de52802072
commit acbfd74983

View File

@@ -8,3 +8,56 @@ else
fi fi
alias ip='ip -c' alias ip='ip -c'
function _kfg {
local -a _options _commands _programs
_programs=(
'all:Install everything'
'zsh:Powerful Shell'
'tmux:Terminal Multiplexer'
'unp:Perl script to make file archive extraction easier'
'bat:cat replacement with syntax highlighting and git integration'
'lsd:ls replacement with colors, icons, tree-view and more'
'omp:Customisable shell prompt renderer'
'zoxide:A smarter cd command'
'fzf:A command-line fuzzy finder'
'fzf-tab:Replace zsh default completion selection menu with fzf'
)
_commands=(
'update:Update kfg'
'install:Install programs and configs'
'version:Print version number'
)
_options=(
{-h,--help}'[Show this help]'
{-y,--yes}'[Skip confirmation questions]'
#{-a,--arch}' STRING [Set the architecture string to be used when downloading files from repositories. Most common are "amd64", "arm64", "armhf", etc]'
{-d,--debug}'[Print debug output]'
)
function _kfg_install {
_arguments -C '*:: :->subcmds'
if (( CURRENT == 1 ));then
_describe -t programs "kfg install programs" _programs
return
else
_arguments $_options
return
fi
}
_arguments -C '*:: :->subcmds'
if (( CURRENT == 1 ));then
_describe -t commands "kfg command" _commands
return
fi
case "$words[1]" in
install) _kfg_install && return 0 ;;
*) _kfg_options && return 0 ;;
esac
}
compdef _kfg kfg