Skip to content

Commit

Permalink
Merge pull request #369 from Jaagrav/fix/version-help-improvements
Browse files Browse the repository at this point in the history
Fix print content for -v -h & version for version -h as well
  • Loading branch information
keizer619 authored Nov 4, 2024
2 parents 8427ae6 + f6405c8 commit fb0de7d
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions resources/bin/bal
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@
export BALLERINA_HOME

if test -f "$BALLERINA_HOME/bin/./bal"; then
$BALLERINA_HOME/bin/./bal "$@"
if { [ "$1" == "-v" ] || [ "$1" == "--version" ] || [ "$1" == "version" ]; } && { [ "$2" == "-h" ] || [ "$2" == "--help" ] || [ "$2" == "help" ]; }
then
$BALLERINA_HOME/bin/./bal version --help
else
$BALLERINA_HOME/bin/./bal "$@"
fi

else
if test -f "$BALLERINA_HOME/bin/./ballerina"; then
$BALLERINA_HOME/bin/./ballerina "$@"
Expand All @@ -136,12 +142,19 @@
EXIT_CODE=$?
fi

if [ "$1" == "help" ] && [ "$2" == "" ] || [ "$1" == "" ] || [ "$1" == "-h" ] || [ "$1" == "--help" ] || \
[ "$1" == "version" ] || [ "$1" == "-v" ] || [ "$1" == "--version" ]
if { [ "$1" == "-v" ] || [ "$1" == "--version" ] || [ "$1" == "version" ]; } && { [ "$2" == "-h" ] || [ "$2" == "--help" ] || [ "$2" == "help" ]; }
then
$JAVA_COMMAND -jar $CURRENT_PATH/../lib/ballerina-command-@[email protected] "$@"
exit $?
else
exit $EXIT_CODE
$BALLERINA_HOME/bin/./bal version
$JAVA_COMMAND -jar $CURRENT_PATH/../lib/ballerina-command-1.4.5-SNAPSHOT.jar "-v"
exit $?
else
if [ "$1" == "help" ] && [ "$2" == "" ] || [ "$1" == "" ] || [ "$1" == "-h" ] || [ "$1" == "--help" ] || \
[ "$1" == "version" ] || [ "$1" == "-v" ] || [ "$1" == "--version" ]
then
$JAVA_COMMAND -jar $CURRENT_PATH/../lib/ballerina-command-1.4.5-SNAPSHOT.jar "$@"
exit $?
else
exit $EXIT_CODE
fi
fi
}; exit

0 comments on commit fb0de7d

Please sign in to comment.