Readd short option for config
This commit is contained in:
parent
ca014d7aac
commit
d9a85e977d
3 changed files with 55 additions and 2 deletions
|
|
@ -39,7 +39,27 @@ _zellij() {
|
|||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:zellij-command-$line[1]:"
|
||||
case $line[1] in
|
||||
(config)
|
||||
(c)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'--clean[Disables loading of configuration file at default location]' \
|
||||
'-h[Prints help information]' \
|
||||
'--help[Prints help information]' \
|
||||
'-V[Prints version information]' \
|
||||
'--version[Prints version information]' \
|
||||
'::path:_files' \
|
||||
&& ret=0
|
||||
;;
|
||||
(c)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'--clean[Disables loading of configuration file at default location]' \
|
||||
'-h[Prints help information]' \
|
||||
'--help[Prints help information]' \
|
||||
'-V[Prints version information]' \
|
||||
'--version[Prints version information]' \
|
||||
'::path:_files' \
|
||||
&& ret=0
|
||||
;;
|
||||
(config)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'--clean[Disables loading of configuration file at default location]' \
|
||||
'-h[Prints help information]' \
|
||||
|
|
@ -70,6 +90,20 @@ _zellij_commands() {
|
|||
)
|
||||
_describe -t commands 'zellij commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_c_commands] )) ||
|
||||
_c_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
_describe -t commands 'c commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_zellij__c_commands] )) ||
|
||||
_zellij__c_commands() {
|
||||
local commands; commands=(
|
||||
|
||||
)
|
||||
_describe -t commands 'zellij c commands' commands "$@"
|
||||
}
|
||||
(( $+functions[_zellij__config_commands] )) ||
|
||||
_zellij__config_commands() {
|
||||
local commands; commands=(
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ _zellij() {
|
|||
cmd="zellij"
|
||||
;;
|
||||
|
||||
c)
|
||||
cmd+="__c"
|
||||
;;
|
||||
config)
|
||||
cmd+="__config"
|
||||
;;
|
||||
|
|
@ -26,7 +29,7 @@ _zellij() {
|
|||
|
||||
case "${cmd}" in
|
||||
zellij)
|
||||
opts=" -m -d -h -V -s -o -l --move-focus --debug --help --version --split --open-file --max-panes --layout config help"
|
||||
opts=" -m -d -h -V -s -o -l --move-focus --debug --help --version --split --open-file --max-panes --layout config help c c"
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
|
|
@ -69,6 +72,21 @@ _zellij() {
|
|||
return 0
|
||||
;;
|
||||
|
||||
zellij__c)
|
||||
opts=" -h -V --clean --help --version <path> "
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
fi
|
||||
case "${prev}" in
|
||||
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
zellij__config)
|
||||
opts=" -h -V --clean --help --version <path> "
|
||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ pub struct CliArgs {
|
|||
#[derive(Debug, StructOpt)]
|
||||
pub enum ConfigCli {
|
||||
/// Path to the configuration yaml file
|
||||
#[structopt(alias = "c")]
|
||||
Config {
|
||||
path: Option<PathBuf>,
|
||||
#[structopt(long)]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue