Open tzejohn opened 7 years ago
You need to use something called bare double dash which is to use the characters --
to signify to the parser that there are no more options after than point.
For example: myapp.exe --path -- \path\to\directory myapp.exe --p -- \path\to\directory
In v2.0 you will be able to do var fclp = new FluentCommandLineParser().UseOwnOptionPrefix("-", "--");
which will omit the "/" prefix altogether solving this issue.
Hi guys, when do you planing to release version 2.0?
@sinistram no strong plan as of yet however if it is UseOwnOptionPrefix
functionality you're after I beleive it is in the commands pre-release https://www.nuget.org/packages/FluentCommandLineParser/1.5.0.20-commands
@siywilliams, nice) Thank you
if you have already an app with this library and cannot modify path, just append parent dots.
dotnet myapp.dll -f /file.txt
error is
Option '-f' parse error: could not parse '' to 'System.String'.
what really should be is something like
dotnet myapp.dll -f ../../../../../../file.txt
(first char not to be /)
and that works!
I have an option where I am passing in path parameters, and these are prefixed by '/'. The parser is interpreting these as additional long options instead of as parameter values for the previous flag. I have tried wrapping the value in double quotes, which does not work. I also tried single quotes. But in that case, the single quotes also get passed through. Is there any way to disable or escape leading '/' values in parameters?