withGetopt: export WITHGETOPT_ORIG_ARGS

This commit is contained in:
tv 2017-10-17 20:06:16 +02:00
parent a15736cbb0
commit 27d37b2299

View File

@ -1,5 +1,5 @@
with import <stockholm/lib>;
{ utillinux, writeDash }:
{ coreutils, quote, utillinux, writeDash }:
opt-spec: cmd-spec: let
@ -43,6 +43,9 @@ in writeDash wrapper-name ''
unset ${opt.varname}
'') opts)}
WITHGETOPT_ORIG_ARGS=$(${quote}/bin/quote "$@")
export WITHGETOPT_ORIG_ARGS
args=$(${utillinux}/bin/getopt \
-l ${shell.escape
(concatMapStringsSep ","