Simplify long-option processing

MFC after:	3 days
X-MFC-to:	stable/10
This commit is contained in:
Devin Teske 2015-09-01 22:37:33 +00:00
parent ded3e7f08e
commit b98a26bf43
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=287389

View File

@ -231,20 +231,16 @@ escape()
#
# Check for `--help' and `--version' command-line option
#
( # Operate in sub-shell to protect $@ in parent
while [ $# -gt 0 ]; do
case "$1" in
--help) help ;;
--version) # see GLOBALS
echo "$SYSRC_VERSION"
exit 1 ;;
-[fRj]) # These flags take an argument
shift 1 ;;
esac
shift 1
done
exit 0
) || die
for arg in "$@"; do
case "$arg" in
--) break ;;
--help) help ;; # NOTREACHED
--version) # see GLOBALS
echo "$SYSRC_VERSION"
exit $FAILURE ;;
esac
done
unset arg
#
# Process command-line flags