From 704b3d479ee9d40c33308df65ed00fd848d78ab6 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Mon, 29 Mar 2021 20:42:52 +0200 Subject: [PATCH] Add completions for the "--target=" argument. --- scripts/completions/bash-completion.sh | 2 +- scripts/completions/fish-completion.fish | 3 ++- scripts/completions/zsh-completion.zsh | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/completions/bash-completion.sh b/scripts/completions/bash-completion.sh index 20c2fee..6b894dc 100644 --- a/scripts/completions/bash-completion.sh +++ b/scripts/completions/bash-completion.sh @@ -8,7 +8,7 @@ _ybconAutoComplete() { COMPREPLY=() current="${COMP_WORDS[COMP_CWORD]}" previous="${COMP_WORDS[COMP_CWORD-1]}" - options='-h -p --help --printresult --version' + options='-h -p --help --target= --printresult --version' if [[ "${current}" == -* ]]; then YCompReply "$(compgen -W "$options" -- "$current")" return 0 diff --git a/scripts/completions/fish-completion.fish b/scripts/completions/fish-completion.fish index 5314154..707fcdb 100644 --- a/scripts/completions/fish-completion.fish +++ b/scripts/completions/fish-completion.fish @@ -3,4 +3,5 @@ set -l commands --help -p --printresult complete -c ybcon -f -a "(__fish_complete_suffix .ybcon)" complete -c ybcon -x -s h -l help -d "Print the help screen" complete -c ybcon -x -l version -d "Print the version" -complete -c ybcon -r -s p -l printresult -d "Enable printing the transpilation result to stdout" \ No newline at end of file +complete -c ybcon -l target= -k -x -a 'lua js py' -d "Set the transpilation target" +complete -c ybcon -s p -l printresult -d "Enable printing the transpilation result to stdout" \ No newline at end of file diff --git a/scripts/completions/zsh-completion.zsh b/scripts/completions/zsh-completion.zsh index faa1501..cbbcb88 100644 --- a/scripts/completions/zsh-completion.zsh +++ b/scripts/completions/zsh-completion.zsh @@ -4,6 +4,7 @@ _ybcon() { _arguments \ '( - 1)'{-h,--help}'[Print the help screen]' \ '( - 1)'--version'[Print the version]' \ + '( - 1)'--target='[Set the transpilation target]:opt:(lua js py)' \ '( - 1)'{-p,--printresult}'[Enable printing the transpilation result to stdout]' \ "*:$completeyfile" return 0