Add completions for the "--target=" argument.

This commit is contained in:
Username404-59 2021-03-29 20:42:52 +02:00
parent 8a2f368795
commit 704b3d479e
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
3 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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"
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"

View File

@ -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