diff --git a/scripts/bash-completion.sh b/scripts/bash-completion.sh index 8e92018..3ad5d82 100644 --- a/scripts/bash-completion.sh +++ b/scripts/bash-completion.sh @@ -5,11 +5,11 @@ _ybconAutoComplete() { COMPREPLY=() current="${COMP_WORDS[COMP_CWORD]}" previous="${COMP_WORDS[COMP_CWORD-1]}" - options="-p --help --printresult" - if [[ ${current} == -* ]]; then - COMPREPLY=( "$(compgen -W "$options" -- "$current")" ) + options='--help --printresult -p' + if [[ "${current}" == -* ]]; then + COMPREPLY=("$(compgen -W "$options" -- "$current")") return 0 fi } -complete -F _ybconAutoComplete ybcon \ No newline at end of file +complete -o nospace -F _ybconAutoComplete ybcon \ No newline at end of file diff --git a/scripts/ybcon.sh b/scripts/ybcon.sh index 5c89ec1..808fc56 100755 --- a/scripts/ybcon.sh +++ b/scripts/ybcon.sh @@ -8,9 +8,9 @@ EXENAME=ybcon defaultBinLocation=/opt/bin/ybcon usage() { - echo "$EXENAME [-h|--help] [-p|-printresult] file" + echo "$EXENAME [-h|--help] [-p|--printresult] file" echo " -h or --help What you're seeing right now" - echo " -p or -printresult Prints the transpilation result to stdout" + echo " -p or --printresult Prints the transpilation result to stdout" } args=""; @@ -32,7 +32,7 @@ if [ "$#" != 0 ]; then echo "Usage:" usage exit 0 ;; - -p | -printresult ) + -p | --printresult ) newArgs "$it" shift ;; *.ybcon ) diff --git a/src/main.cpp b/src/main.cpp index 27e0bb7..aca619e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,7 +18,7 @@ int main(int argc, char* argv[]) { for (int i = 0; i < argc; i++) { currentArg = ((string) argv[i]); - if ((currentArg == "-printresult") || (currentArg == "-p")) printResult = true; + if ((currentArg == "--printresult") || (currentArg == "-p")) printResult = true; else if (currentArg.starts_with("--target=")) target = '.' + currentArg.erase(0, 9); } const string parsedString = parseString(make_unique(getFileContent(fileName)));