You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
parsing fails when value matches name of list parameter #396
classOptions{[Option("deploy",Separator=',',="Projects to deploy")]publicIList<string>Deploys{get;set;}[Option("profile",Required=true,HelpText="Profile to use when restoring and publishing")]publicstringProfile{get;set;}[Option("configure-profile",Required=true,HelpText="Profile to use for Configure")]publicstringConfigureProfile{get;set;}}
Parsing fails if passed --configure-profile deploy --profile local with Required option 'profile' is missing.
I think it's intepreting the deploy value as an option.
Initial findings: the tokenizer returned a Name token for --configure-profile, followed by three Value tokens for deploy, --profile (which is wrong, should have been a Name token) and local.
But I just stepped through the tokenizer and watched it happen, and the tokenizer initially returned a Name token for --profile. But then inside the Tokenizer.ExplodeOptionList method, that Name token was turned into a Value token. So the ExplodeOptionList method is the culprit. I'll continue tracking it down and report more.
BTW, my GetoptTokenizer implementation from PR #684 also contains this bug, because I re-used that ExplodeOptionList method without any changes. So when I find and fix this bug, I'll also submit an update to PR #684. Please don't merge #684 until then, or you'll be merging known-buggy code that I'm working on a fix for.
Activity
moh-hassan commentedon Aug 19, 2020
@rmunn
This is a known issue in the library, see this test case.
Please, can you help in fixing this issue?
rmunn commentedon Aug 20, 2020
@moh-hassan Interesting. I'll take a look.
rmunn commentedon Aug 20, 2020
Initial findings: the tokenizer returned a Name token for
--configure-profile, followed by three Value tokens fordeploy,--profile(which is wrong, should have been a Name token) andlocal.But I just stepped through the tokenizer and watched it happen, and the tokenizer initially returned a Name token for
--profile. But then inside the Tokenizer.ExplodeOptionList method, that Name token was turned into a Value token. So the ExplodeOptionList method is the culprit. I'll continue tracking it down and report more.BTW, my GetoptTokenizer implementation from PR #684 also contains this bug, because I re-used that ExplodeOptionList method without any changes. So when I find and fix this bug, I'll also submit an update to PR #684. Please don't merge #684 until then, or you'll be merging known-buggy code that I'm working on a fix for.
rmunn commentedon Aug 20, 2020
Related, though not the same bug: #687 (which I'll also submit a fix for).
Fix enumerable options grabbing too many values
rmunn commentedon Aug 20, 2020
PR #684 now has a fix for this bug (in commit 47618e0).