From fda58a2ff7152db8e63b46de253759393c32b5a0 Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Mon, 24 Aug 2026 14:00:44 -0500 Subject: [PATCH] Added a test to see if it works --- src/cligen/command_node.cr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cligen/command_node.cr b/src/cligen/command_node.cr index 5cfb0a6..e250c14 100644 --- a/src/cligen/command_node.cr +++ b/src/cligen/command_node.cr @@ -217,7 +217,9 @@ module CliGen # error message if caught handle_flag_raises do if match.requires_arg? - match.process(args.reject(&.processed?).take_while{|v| find_match(v.value) == CliGen::MatchType::NoMatch}) + match.process(args.reject(&.processed?).take_while{|v| + find_match(v.value) == CliGen::MatchType::NoMatch || !!match.meta.options.try(&.includes?(v.value)) + }) else match.process end @@ -258,7 +260,9 @@ module CliGen ## If this is the last flag provided in the clump do the thing if index == chars.size - 1 if match.requires_arg? - match.process(args.reject(&.processed?).take_while{|v| find_match(v.value) == CliGen::MatchType::NoMatch}) + match.process(args.reject(&.processed?).take_while{|v| + find_match(v.value) == CliGen::MatchType::NoMatch || !! match.meta.options.try(&.includes?(v.value)) + }) else match.process end