aboutsummaryrefslogtreecommitdiff
path: root/src/libmain/shared.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-10-24 12:45:11 +0200
committerEelco Dolstra <edolstra@gmail.com>2017-10-24 12:58:34 +0200
commit0d59f1ca49c9f7f3b2edaadcf590360ec66a6257 (patch)
treea03d53d84fb61eb354e2634705d8a076f0c1c76d /src/libmain/shared.hh
parent25f32625e2f2a3a1e1b3a3811da82f21c3a3b880 (diff)
nix: Respect -I, --arg, --argstr
Also, random cleanup to argument handling.
Diffstat (limited to 'src/libmain/shared.hh')
-rw-r--r--src/libmain/shared.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libmain/shared.hh b/src/libmain/shared.hh
index 2a1e42dd9..9219dbed8 100644
--- a/src/libmain/shared.hh
+++ b/src/libmain/shared.hh
@@ -2,6 +2,7 @@
#include "util.hh"
#include "args.hh"
+#include "common-args.hh"
#include <signal.h>
@@ -69,6 +70,19 @@ template<class N> N getIntArg(const string & opt,
}
+struct LegacyArgs : public MixCommonArgs
+{
+ std::function<bool(Strings::iterator & arg, const Strings::iterator & end)> parseArg;
+
+ LegacyArgs(const std::string & programName,
+ std::function<bool(Strings::iterator & arg, const Strings::iterator & end)> parseArg);
+
+ bool processFlag(Strings::iterator & pos, Strings::iterator end) override;
+
+ bool processArgs(const Strings & args, bool finish) override;
+};
+
+
/* Show the manual page for the specified program. */
void showManPage(const string & name);