fix(args): fix bug in arguments who are required and mutually exclusive

When arguments are required-by-default and also mutually exclusive with
other arguments and the user chooses the mutually eclusive argument, the
requirements must be updated as well.
This commit is contained in:
Kevin K 2015-03-30 20:41:26 -04:00
parent 918f52ea35
commit 6ceb88a594

View file

@ -800,6 +800,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
if let Some(ref bl) = p.blacklist {
for name in bl {
self.blacklist.insert(name);
self.required.remove(name);
}
}
if self.required.contains(p.name) {
@ -948,6 +949,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
if let Some(ref bl) = v.blacklist {
for name in bl {
self.blacklist.insert(name);
self.required.remove(name);
}
}
if self.required.contains(v.name) {
@ -1005,6 +1007,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
if let Some(ref bl) = v.blacklist {
for name in bl {
self.blacklist.insert(name);
self.required.remove(name);
}
}
@ -1070,6 +1073,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
if let Some(ref bl) = v.blacklist {
for name in bl {
self.blacklist.insert(name);
self.required.remove(name);
}
}
if self.required.contains(v.name) {
@ -1130,6 +1134,7 @@ impl<'a, 'v, 'ab, 'u, 'ar> App<'a, 'v, 'ab, 'u, 'ar>{
if let Some(ref bl) = v.blacklist {
for name in bl {
self.blacklist.insert(name);
self.required.remove(name);
}
}