From 3f4aed13897fd4e5dcbf938b80f1a9d19ae95149 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Wed, 7 Jul 2021 19:07:47 +0200 Subject: [PATCH] Add support for the --parallel argument in shell scripts. --- scripts/completions/bash-completion.sh | 2 +- scripts/completions/fish-completion.fish | 1 + scripts/completions/zsh-completion.zsh | 1 + scripts/ybcon | 5 +++-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/completions/bash-completion.sh b/scripts/completions/bash-completion.sh index 6b894dc..bc093da 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 --target= --printresult --version' + options='-h -p --help --parallel --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 a25a89c..cd96902 100644 --- a/scripts/completions/fish-completion.fish +++ b/scripts/completions/fish-completion.fish @@ -3,5 +3,6 @@ set -l commands --version -h --help --target= -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 -l parallel -k -d "Transpile files in parallel mode" complete -c ybcon -l target -k -f -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 c770b69..02dddfe 100644 --- a/scripts/completions/zsh-completion.zsh +++ b/scripts/completions/zsh-completion.zsh @@ -4,6 +4,7 @@ _ybcon() { _arguments \ '( - 0)'{-h,--help}'[Print the help screen]' \ '( - 0)'--version'[Print the version]' \ + --parallel'[Transpile files in parallel mode]' \ --target='[Set the transpilation target]:language:(lua js py)' \ {-p,--printresult}'[Enable printing the transpilation result to stdout]' \ "*:$completeyfile" diff --git a/scripts/ybcon b/scripts/ybcon index 97b8420..57e4f96 100755 --- a/scripts/ybcon +++ b/scripts/ybcon @@ -11,10 +11,11 @@ defaultBinLocation="$scriptDir/../libexec/ybcon" usage() { if [ "$1" = false ]; then echo "Invalid arguments, usage:"; fi - echo "$EXENAME [--version] [-h|--help] [--target=] [-p|--printresult] " + echo "$EXENAME [--version] [-h|--help] [--parallel] [--target=] [-p|--printresult] " if [ "$1" = true ]; then echo " --version Print the version" echo " -h or --help What you're seeing right now" + echo " --parallel Transpile files in parallel mode" echo " --target= Set the transpilation target" echo " -p or --printresult Enable printing the transpilation result to stdout" printf "\n" @@ -53,7 +54,7 @@ if [ "$#" != 0 ]; then for it in "$@" do case "$it" in - -p | --printresult | --target=* ) + -p | --printresult | --parallel | --target=* ) if test "${args#*$it}" = "$args"; then newArgs "$it" else