Files
dotfiles/.config/sh/_kfg.rc
Christopher Beckmann 4f35a25c10 umstrukturiert
2023-05-26 17:00:58 +02:00

53 lines
1.4 KiB
Plaintext

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 ;;
*) return 0 ;;
esac
}
compdef _kfg kfg