aboutsummaryrefslogtreecommitdiff
path: root/paludis/args/args_visitor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/args/args_visitor.cc')
-rw-r--r--paludis/args/args_visitor.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/paludis/args/args_visitor.cc b/paludis/args/args_visitor.cc
index 700f047d3..af8ec032f 100644
--- a/paludis/args/args_visitor.cc
+++ b/paludis/args/args_visitor.cc
@@ -91,8 +91,14 @@ void ArgsVisitor::visit(StringArg & arg)
if (! _imp->env_prefix.empty())
setenv(env_name(arg.long_name()).c_str(), p.c_str(), 1);
}
- else
+ else if (! arg.can_be_negated())
throw BadArgument("--no-" + arg.long_name());
+ else
+ {
+ arg.set_specified(false);
+ if (! _imp->env_prefix.empty())
+ unsetenv(env_name(arg.long_name()).c_str());
+ }
}
void ArgsVisitor::visit(AliasArg & arg)