In C# I parse a path ending with '\', like this: -p "C:\My Folder\". The problem is, when parsing I get C:\My Folder" (with the final quote), instead of just C:\My Folder. Is there a way to avoid this problem? I've already tried with CommandLineParser and NDesk.Options, both ended up with the same problem...
The Options class:
class Options
{
[Option('p', "path", Required = false)]
public string parsedPath { get; set; }
[Option('f', "file", Required = false)]
public string parsedFile { get; set; }
[Option('l', "label", Required = false)]
public string parsedLabel { get; set; }
[Option('t', "torrent", DefaultValue = false)]
public bool isTorrent { get; set; }
}
The code implementation:
var options = new Options();
CommandLine.Parser parser = new CommandLine.Parser();
parser.ParseArguments(args, options);
EDIT: I'm using the Command Line Parser Library library