summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
Diffstat (limited to 'krebs')
-rw-r--r--krebs/5pkgs/simple/withGetopt.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/krebs/5pkgs/simple/withGetopt.nix b/krebs/5pkgs/simple/withGetopt.nix
index 21322b783..b7bd40126 100644
--- a/krebs/5pkgs/simple/withGetopt.nix
+++ b/krebs/5pkgs/simple/withGetopt.nix
@@ -45,9 +45,11 @@ in writeDash wrapper-name ''
args=$(${utillinux}/bin/getopt \
-n "$wrapper_name" \
-o "" \
- -l ${concatMapStringsSep ","
- (opt: opt.long + optionalString (!opt.switch) ":")
- (attrValues opts)} \
+ -l ${shell.escape
+ (concatMapStringsSep ","
+ (opt: opt.long + optionalString (!opt.switch) ":")
+ (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