withGetopt: make long option optional
This commit is contained in:
parent
8179f87e5a
commit
9f85824da2
@ -45,9 +45,11 @@ in writeDash wrapper-name ''
|
||||
args=$(${utillinux}/bin/getopt \
|
||||
-n "$wrapper_name" \
|
||||
-o "" \
|
||||
-l ${concatMapStringsSep ","
|
||||
-l ${shell.escape
|
||||
(concatMapStringsSep ","
|
||||
(opt: opt.long + optionalString (!opt.switch) ":")
|
||||
(attrValues opts)} \
|
||||
(filter (opt: opt.long != null)
|
||||
(attrValues opts)))} \
|
||||
-s sh \
|
||||
-- "$@")
|
||||
if \test $? != 0; then exit 1; fi
|
||||
@ -65,7 +67,9 @@ in writeDash wrapper-name ''
|
||||
shift 2
|
||||
''}
|
||||
;;
|
||||
'') opts)}
|
||||
'') (filterAttrs
|
||||
(_: opt: opt.long != null)
|
||||
opts))}
|
||||
--)
|
||||
shift
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user