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