Skip to content

Commit

Permalink
fix(args): fix bug in arguments who are required and mutually exclusive
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kbknapp committed Apr 1, 2015
1 parent 918f52e commit 6ceb88a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 6ceb88a

Please sign in to comment.