Experimental package creation tool for MinGW.org
リビジョン | 1c5206f7fce5b491d85aefbb658e70d73c4ec7a4 (tree) |
---|---|
日時 | 2018-07-05 01:32:41 |
作者 | Keith Marshall <keith@user...> |
コミッター | Keith Marshall |
Another optstring decomposition optimization.
* src/modules/optdefn.sh (optchk): Prefer to use...
(optstring_get_optchk, optstring_get_remnant): ...these, to extract
the next available option character, and the remainder of the current
option string, when parsing short form options, rather than forking
the "cut" command explicitly.
@@ -237,7 +237,8 @@ | ||
237 | 237 | # or the external "getopt" program, neither of which can be relied |
238 | 238 | # upon to support optional option-argument processing). |
239 | 239 | # |
240 | - do opt=`echo "$arg" | cut -c1` arg=`echo "$arg" | cut -c2-` | |
240 | + do opt=`optstring_get_optchr "$arg"` | |
241 | + arg=`optstring_get_remnant "$arg"` | |
241 | 242 | have_optmatch=false argshift=0 |
242 | 243 | for optchr in $shortopts '??' |
243 | 244 | do $have_optmatch || { |