guix-commits
[Top][All Lists]
Advanced

[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);
     }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]