Date: Mon, 2 Nov 2015 22:54:45 +0000 (UTC) From: Devin Teske <dteske@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290310 - stable/10/usr.sbin/sysrc Message-ID: <201511022254.tA2MsjrM092103@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dteske Date: Mon Nov 2 22:54:45 2015 New Revision: 290310 URL: https://svnweb.freebsd.org/changeset/base/290310 Log: MFC r287389: Simplify long-option processing Modified: stable/10/usr.sbin/sysrc/sysrc Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/sysrc/sysrc ============================================================================== --- stable/10/usr.sbin/sysrc/sysrc Mon Nov 2 22:49:39 2015 (r290309) +++ stable/10/usr.sbin/sysrc/sysrc Mon Nov 2 22:54:45 2015 (r290310) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511022254.tA2MsjrM092103>