diff options
| author | a-kenji <aks.kenji@protonmail.com> | 2021-04-21 08:58:38 +0200 |
|---|---|---|
| committer | a-kenji <aks.kenji@protonmail.com> | 2021-04-21 09:03:46 +0200 |
| commit | 2c12e8ff8324b3ebaa10ac8162af09f5da295e1b (patch) | |
| tree | 674d5988c5ca0a34e6931798467fed61b45da3cf /assets | |
| parent | fix(release): beta tag breaks cargo install (diff) | |
| download | sl0ppij-2c12e8ff8324b3ebaa10ac8162af09f5da295e1b.tar.gz sl0ppij-2c12e8ff8324b3ebaa10ac8162af09f5da295e1b.tar.xz sl0ppij-2c12e8ff8324b3ebaa10ac8162af09f5da295e1b.zip | |
Change Config To Flag (#290)
This changes the `config` subcommand to a config flag.
Add option subcommand for now, for the clearing of default path.
Add `ZELLIJ_CONFIG` environment variable.
The configuration locations are now as follows:
* `--config` flag
* `ZELLIJ_CONFIG` environment variable
* default config location
in that order.
Diffstat (limited to 'assets')
| -rw-r--r-- | assets/completions/_zellij | 53 | ||||
| -rw-r--r-- | assets/completions/zellij.bash | 42 | ||||
| -rw-r--r-- | assets/completions/zellij.fish | 9 |
3 files changed, 31 insertions, 73 deletions
diff --git a/assets/completions/_zellij b/assets/completions/_zellij index 9eecf8e2..774a28fa 100644 --- a/assets/completions/_zellij +++ b/assets/completions/_zellij @@ -23,6 +23,8 @@ _zellij() { '--data-dir=[Change where zellij looks for layouts and plugins]' \ '-l+[Path to a layout yaml file]' \ '--layout=[Path to a layout yaml file]' \ +'-c+[Change where zellij looks for the configuration]' \ +'--config=[Change where zellij looks for the configuration]' \ '-m[Send "move focused pane" to active zellij session]' \ '--move-focus[Send "move focused pane" to active zellij session]' \ '-d[]' \ @@ -40,34 +42,13 @@ _zellij() { (( CURRENT += 1 )) curcontext="${curcontext%:*:*}:zellij-command-$line[1]:" case $line[1] in - (c) + (option) _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]' \ -'--help[Prints help information]' \ -'-V[Prints version information]' \ -'--version[Prints version information]' \ -'::path:_files' \ && ret=0 ;; (help) @@ -86,38 +67,24 @@ esac (( $+functions[_zellij_commands] )) || _zellij_commands() { local commands; commands=( - "config:Path to the configuration yaml file" \ + "option:Change the behaviour of zellij" \ "help:Prints this message or the help of the given subcommand(s)" \ ) _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() { +(( $+functions[_zellij__help_commands] )) || +_zellij__help_commands() { local commands; commands=( ) - _describe -t commands 'zellij config commands' commands "$@" + _describe -t commands 'zellij help commands' commands "$@" } -(( $+functions[_zellij__help_commands] )) || -_zellij__help_commands() { +(( $+functions[_zellij__option_commands] )) || +_zellij__option_commands() { local commands; commands=( ) - _describe -t commands 'zellij help commands' commands "$@" + _describe -t commands 'zellij option commands' commands "$@" } _zellij "$@"
\ No newline at end of file diff --git a/assets/completions/zellij.bash b/assets/completions/zellij.bash index 4f28140a..9cd8f890 100644 --- a/assets/completions/zellij.bash +++ b/assets/completions/zellij.bash @@ -13,15 +13,12 @@ _zellij() { cmd="zellij" ;; - c) - cmd+="__c" - ;; - config) - cmd+="__config" - ;; help) cmd+="__help" ;; + option) + cmd+="__option" + ;; *) ;; esac @@ -29,7 +26,7 @@ _zellij() { case "${cmd}" in zellij) - opts=" -m -d -h -V -s -o -l --move-focus --debug --help --version --split --open-file --max-panes --data-dir --layout config help c c" + opts=" -m -d -h -V -s -o -l -c --move-focus --debug --help --version --split --open-file --max-panes --data-dir --layout --config option help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -68,22 +65,14 @@ _zellij() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; - *) - COMPREPLY=() + --config) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -c) + COMPREPLY=($(compgen -f "${cur}")) + return 0 ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - 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=() ;; @@ -91,8 +80,9 @@ _zellij() { COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; - zellij__config) - opts=" -h -V --clean --help --version <path> " + + zellij__help) + opts=" -h -V --help --version " if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -106,8 +96,8 @@ _zellij() { COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; - zellij__help) - opts=" -h -V --help --version " + zellij__option) + opts=" -h -V --clean --help --version " if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 diff --git a/assets/completions/zellij.fish b/assets/completions/zellij.fish index ec758be6..4c1e536f 100644 --- a/assets/completions/zellij.fish +++ b/assets/completions/zellij.fish @@ -3,14 +3,15 @@ complete -c zellij -n "__fish_use_subcommand" -s o -l open-file -d 'Send "open f complete -c zellij -n "__fish_use_subcommand" -l max-panes -d 'Maximum panes on screen, caution: opening more panes will close old ones' complete -c zellij -n "__fish_use_subcommand" -l data-dir -d 'Change where zellij looks for layouts and plugins' complete -c zellij -n "__fish_use_subcommand" -s l -l layout -d 'Path to a layout yaml file' +complete -c zellij -n "__fish_use_subcommand" -s c -l config -d 'Change where zellij looks for the configuration' complete -c zellij -n "__fish_use_subcommand" -s m -l move-focus -d 'Send "move focused pane" to active zellij session' complete -c zellij -n "__fish_use_subcommand" -s d -l debug complete -c zellij -n "__fish_use_subcommand" -s h -l help -d 'Prints help information' complete -c zellij -n "__fish_use_subcommand" -s V -l version -d 'Prints version information' -complete -c zellij -n "__fish_use_subcommand" -f -a "config" -d 'Path to the configuration yaml file' +complete -c zellij -n "__fish_use_subcommand" -f -a "option" -d 'Change the behaviour of zellij' complete -c zellij -n "__fish_use_subcommand" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)' -complete -c zellij -n "__fish_seen_subcommand_from config" -l clean -d 'Disables loading of configuration file at default location' -complete -c zellij -n "__fish_seen_subcommand_from config" -s h -l help -d 'Prints help information' -complete -c zellij -n "__fish_seen_subcommand_from config" -s V -l version -d 'Prints version information' +complete -c zellij -n "__fish_seen_subcommand_from option" -l clean -d 'Disables loading of configuration file at default location' +complete -c zellij -n "__fish_seen_subcommand_from option" -s h -l help -d 'Prints help information' +complete -c zellij -n "__fish_seen_subcommand_from option" -s V -l version -d 'Prints version information' complete -c zellij -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information' complete -c zellij -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information' |
