dotnet / command-line-api

Command line parsing, invocation, and rendering of terminal output.
https://github.com/dotnet/command-line-api/wiki
MIT License
3.42k stars 382 forks source link

Auto-removing quatation marks #1345

Open Miliver opened 3 years ago

Miliver commented 3 years ago

Parser automatically removes quatation marks from begin or end of a arguments value (i. e. -name="miliver => -name=miliver).

string input = "run -name=\"miliver";
var rootCommand = new RootCommand
    {
      new Option
      (
         name: "-name",
       )
     };
string userName;
rootCommand.Handler = CommandHandler.Create<string>((name) =>
{
    userName = name;
});
await rootCommand.InvokeAsync(args);

//userName = miliver

I'm not sure if this is a bug or feature? Thank you for answer.

jonsequitur commented 3 years ago

This looks like a bug.