Closed poison2k closed 3 years ago
Updated Issue report after I can reproduce the error on Windwos with CommandDotNet.Example App
Thank you for posting this. I will investigate over the weekend.
Good catch. This one was easy to test and resolve. The framework will now fail with a suggestion to remove the prefix. @poison2k I'm considering a few different options.
If you look at git branch
, if we git --branch
, it prints the unknown option: --branch
. I can keep that at the minimum but am considering the following two options for suggestion to the user
Unrecognized option '--branch'. If you intended to use the 'branch' command, try again without the '--'
or
Unrecognized option '--branch'.
If you intended to use the 'branch' command, try again with the following
branch
in you last of example of myapp do --something
, the latter would be
Unrecognized option '--something'.
If you intended to use the 'something' command, try again with the following
myapp do something
Which do you think will be more helpful?
Hello and thanks for your fast work. I would prefer the last option:
Unrecognized option '--something'.
If you intended to use the 'something' command, try again with the following
myapp do something
This is very clear and helps the user to do it the right way.
That's my preference too. I'm doing a simple replace text on what the user entered. If the entered text also includes an option with the same name as the command, that could be unintentionally replaced, but I consider that highly unlikely.
Works fine, tested is :)
Can you please upload the nuget package file for the 4.1.9 release on nuget.org that I can add it to our build server.
Thank you.
@poison2k we're having some issues with Travis. I've asked @bilal-fazlani to publish CommandDotNet_4.1.9 the package to Nuget in the meantime.
nuget https://www.nuget.org/packages/CommandDotNet/4.1.13 just published
Hello I have the current Problem: if a user tried to use a known command with leading -- I get an error.
I am using Oracle Linux with .netcore 3.1.1. All other defined commands and options running perfect.
Example: myapp has some known commands
myapp setup
myapp update
myapp do something
If I use now:
myapp --setup
ormyapp --update
ormyapp do --something
I get the Error on end of my post:
Update 30.07.2021 I can reproduce the error on Windows and with the CommandDotNet.Example App in this git repo If you use the following command of the example app:
CommandDotNet.Example.exe git commit
all works fine, but if you enterCommandDotNet.Example.exe git **--commit**
The program runs in the same parse error.So I would say this is a real bug and must be fixed.