[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/118: Ugly hack to allow --argstr values starting with a dash
From: |
Ludovic Courtès |
Subject: |
04/118: Ugly hack to allow --argstr values starting with a dash |
Date: |
Tue, 19 May 2015 14:45:07 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit 0321ef9bb261958fe4d63210e9a9d3350737ef18
Author: Eelco Dolstra <address@hidden>
Date: Fri May 23 14:43:55 2014 +0200
Ugly hack to allow --argstr values starting with a dash
Fixes #265.
---
src/libmain/shared.cc | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index a390654..1426344 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -220,6 +220,13 @@ static void initAndRun(int argc, char * * argv)
string value = *i;
settings.set(name, value);
}
+ else if (arg == "--arg" || arg == "--argstr") {
+ remaining.push_back(arg);
+ ++i; if (i == args.end()) throw UsageError(format("`%1%' requires
two arguments") % arg);
+ remaining.push_back(*i);
+ ++i; if (i == args.end()) throw UsageError(format("`%1%' requires
two arguments") % arg);
+ remaining.push_back(*i);
+ }
else remaining.push_back(arg);
}
- 05/118: Shut up some signedness warnings, (continued)
- 05/118: Shut up some signedness warnings, Ludovic Courtès, 2015/05/19
- 02/118: nix-store -l: Fetch build logs from the Internet, Ludovic Courtès, 2015/05/19
- 03/118: Disable parallel.sh test, Ludovic Courtès, 2015/05/19
- 07/118: Add constant ‘nixPath’, Ludovic Courtès, 2015/05/19
- 14/118: Use std::unordered_set, Ludovic Courtès, 2015/05/19
- 13/118: nix-build: --add-root also takes 1 parameter, Ludovic Courtès, 2015/05/19
- 16/118: Fix test, Ludovic Courtès, 2015/05/19
- 15/118: Sort nixPath attributes, Ludovic Courtès, 2015/05/19
- 10/118: Remove ExprBuiltin, Ludovic Courtès, 2015/05/19
- 09/118: Make the Nix search path declarative, Ludovic Courtès, 2015/05/19
- 04/118: Ugly hack to allow --argstr values starting with a dash,
Ludovic Courtès <=
- 19/118: Report daemon OOM better, Ludovic Courtès, 2015/05/19
- 06/118: Add primop ‘scopedImport’, Ludovic Courtès, 2015/05/19
- 21/118: Add autoloads, make code more concise & idiomatic, Ludovic Courtès, 2015/05/19
- 25/118: Fix bogus warnings about dumping large paths, Ludovic Courtès, 2015/05/19
- 20/118: == operator: Ignore string context, Ludovic Courtès, 2015/05/19
- 17/118: nix-env -qa --json: Generate valid JSON even if there are invalid meta attrs, Ludovic Courtès, 2015/05/19
- 23/118: findFile: Realise the context of the path attributes, Ludovic Courtès, 2015/05/19
- 11/118: Rephrase @ operator description, Ludovic Courtès, 2015/05/19
- 29/118: Merge branch 'shlevy-import-native', Ludovic Courtès, 2015/05/19
- 12/118: dev-shell is a bash script, not sh, Ludovic Courtès, 2015/05/19