mirror of
https://github.com/PapirusDevelopmentTeam/papirus-folders.git
synced 2024-09-19 11:08:48 -04:00
Change exit code when parser fails
This commit is contained in:
parent
d16965de73
commit
a16556e957
1 changed files with 5 additions and 5 deletions
|
@ -384,7 +384,7 @@ parse_args() {
|
|||
|
||||
# Show help if no argument is passed
|
||||
if [ -z "$1" ]; then
|
||||
usage 128
|
||||
usage 2
|
||||
fi
|
||||
|
||||
# Translate --gnu-long-options to -g (short options)
|
||||
|
@ -401,7 +401,7 @@ parse_args() {
|
|||
--version) args+=( -V ) ;;
|
||||
--[0-9a-Z]*)
|
||||
err "illegal option -- '$arg'"
|
||||
usage 128
|
||||
usage 2
|
||||
;;
|
||||
*) args+=("$arg")
|
||||
esac
|
||||
|
@ -426,10 +426,10 @@ parse_args() {
|
|||
;;
|
||||
h ) usage 0 ;;
|
||||
: ) err "option requires an argument -- '-$OPTARG'"
|
||||
usage 128
|
||||
usage 2
|
||||
;;
|
||||
\?) err "illegal option -- '-$OPTARG'"
|
||||
usage 128
|
||||
usage 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
@ -439,7 +439,7 @@ parse_args() {
|
|||
# Return an error if any positional parameters are found
|
||||
if [ -n "$1" ]; then
|
||||
err "illegal parameter -- '$1'"
|
||||
usage 128
|
||||
usage 2
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue