Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid parsing when argument value begins with a slash #26

Closed
Skippeh opened this issue Feb 6, 2017 · 2 comments
Closed

Invalid parsing when argument value begins with a slash #26

Skippeh opened this issue Feb 6, 2017 · 2 comments

Comments

@Skippeh
Copy link

Skippeh commented Feb 6, 2017

If you for example have:

--filePath /root/folder

You will get the error:

Grouping of multiple short name arguments in one word(e.g. -a -b into -ab) is allowed only for switch arguments.Argument r is not a switch argument.

Surrounding the path with quotation marks doesn't help.

@j-maly
Copy link
Owner

j-maly commented Feb 6, 2017

Hi, thanks for reporting this, I'll fix it.
As a workaround, setting CommandLineParser.AcceptSlash to false might help here.

@j-maly
Copy link
Owner

j-maly commented Feb 11, 2017

This is a problem of some features being enabled by default not playing well together in this case. So you can disable one of these
AllowShortSwitchGrouping (which is for treating -abc as -a -b -c)
AcceptSlash (which allows switches written as /a /b /c)

But I've added a check to the parser to be less eager trying to expand switches. So your example
--filePath /root/folder
should work in the next version, even with the default settings.

@j-maly j-maly closed this as completed in 3fed219 Feb 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants