Skip to content

Commit 1334f79

Browse files
committed
style: Group commands in optional arg parsing
Found via shellcheck on input with an optional argument, which warns ^-- SC2015: Note that A && B || C is not if-then-else. C may run when A is true. SC2015: https://www.shellcheck.net/wiki/SC2015
1 parent 6bcbfc8 commit 1334f79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stuff.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ m4_define([_PASS_WHEN_GETOPT], [m4_ifnblank([$1], [m4_do(
12691269
[[[_next="${_key##-$1}"]],
12701270
[[if test -n "$_next" -a "$_next" != "$_key"]],
12711271
[[then]],
1272-
[_INDENT_()[begins_with_short_option "$_next" && shift && set -- "-$1" "-${_next}" "@S|@@" || die "The short option '$_key' can't be decomposed to ${_key:0:2} and -${_key:2}, because ${_key:0:2} doesn't accept value and '-${_key:2:1}' doesn't correspond to a short option."]],
1272+
[_INDENT_()[{ begins_with_short_option "$_next" && shift && set -- "-$1" "-${_next}" "@S|@@"; } || die "The short option '$_key' can't be decomposed to ${_key:0:2} and -${_key:2}, because ${_key:0:2} doesn't accept value and '-${_key:2:1}' doesn't correspond to a short option."]],
12731273
[[fi]]])],
12741274
)])])
12751275

0 commit comments

Comments
 (0)