From 66f85d07a0e5d53ecf4e72a746d7265db75c21a3 Mon Sep 17 00:00:00 2001 From: CreepySkeleton Date: Tue, 21 Apr 2020 14:17:18 +0300 Subject: [PATCH] Some extra debugging --- src/build/app/mod.rs | 8 ++++++-- src/parse/validator.rs | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs index 77fc5c10..e2c6dbde 100644 --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -1975,22 +1975,26 @@ impl<'b> App<'b> { } pub(crate) fn unroll_args_in_group(&self, group: &Id) -> Vec { + debugln!("App::unroll_args_in_group: group={:?}", group); let mut g_vec = vec![group]; let mut args = vec![]; - while let Some(ref g) = g_vec.pop() { + while let Some(g) = g_vec.pop() { for n in self .groups .iter() - .find(|grp| grp.id == **g) + .find(|grp| grp.id == *g) .expect(INTERNAL_ERROR_MSG) .args .iter() { + debugln!("App::unroll_args_in_group:iter: entity={:?}", n); if !args.contains(n) { if self.find(n).is_some() { + debugln!("App::unroll_args_in_group:iter: this is an arg"); args.push(n.clone()) } else { + debugln!("App::unroll_args_in_group:iter: this is a group"); g_vec.push(n); } } diff --git a/src/parse/validator.rs b/src/parse/validator.rs index 3adddf07..f5edf2db 100644 --- a/src/parse/validator.rs +++ b/src/parse/validator.rs @@ -307,7 +307,7 @@ impl<'b, 'c, 'z> Validator<'b, 'c, 'z> { // args in that group to the conflicts, as well as any args those args conflict // with - // // FIXME: probably no need to cone the id here. Review the macro + // // FIXME: probably no need to clone the id here. Review the macro for grp in groups_for_arg!(self.p.app, name.clone()) { if let Some(g) = self .p @@ -508,10 +508,12 @@ impl<'b, 'c, 'z> Validator<'b, 'c, 'z> { for arg_or_group in self.p.required.iter().filter(|r| !matcher.contains(r)) { debugln!("Validator::validate_required:iter:aog={:?};", arg_or_group); if let Some(arg) = self.p.app.find(&arg_or_group) { + debugln!("Validator::validate_required:iter: This is an arg"); if !self.is_missing_required_ok(arg, matcher) { return self.missing_required_error(matcher, None); } } else if let Some(group) = self.p.app.groups.iter().find(|g| g.id == *arg_or_group) { + debugln!("Validator::validate_required:iter: This is a group"); if !self .p .app