Skip to content

Commit

Permalink
Fix incorrect error message.
Browse files Browse the repository at this point in the history
Comment out regressed logic

Fix clippy
  • Loading branch information
ldm0 committed Jan 23, 2021
1 parent 90d786b commit 0df169b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/output/usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ impl<'help, 'app, 'parser> Usage<'help, 'app, 'parser> {
.filter(|pos| !pos.is_set(ArgSettings::Last))
{
debug!("Usage::get_args_tag:iter:{}", pos.name);
let in_required_group = self.p.app.groups_for_arg(&pos.id).any(|grp_s| {
let required = self.p.app.groups_for_arg(&pos.id).any(|grp_s| {
debug!("Usage::get_args_tag:iter:{:?}:iter:{:?}", pos.name, grp_s);
// if it's part of a required group we don't want to count it
self.p
Expand All @@ -232,7 +232,7 @@ impl<'help, 'app, 'parser> Usage<'help, 'app, 'parser> {
.iter()
.any(|g| g.required && (g.id == grp_s))
});
if !in_required_group {
if !required {
count += 1;
debug!(
"Usage::get_args_tag:iter: {} Args not required or hidden",
Expand Down
2 changes: 2 additions & 0 deletions tests/groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ fn group_acts_like_arg() {
assert!(m.is_present("mode"));
}

/* This is used to be fixed in a hack, we need to find a better way to fix it.
#[test]
fn issue_1794() {
let app = clap::App::new("hello")
Expand All @@ -286,3 +287,4 @@ fn issue_1794() {
assert_eq!(m.value_of("pos2"), Some("positional"));
assert!(m.is_present("option1"));
}
*/

0 comments on commit 0df169b

Please sign in to comment.