The default functionality below is not being executed when I execute myExe.exe
, it is however being executed when I run myExe.exe -launch
. Any thoughts on why this application isn't executing by default? According to the Documentation this should work
Excerpt from Documentation:
As a fallback, a default handler may be registered which will handle all arguments which are not handled by any of the above matching algorithms. The default handler is designated by the name <> (which may be an alias for another named NDesk.Options.Option).
My Code:
public static void Main (string[] args)
{
bool showHelp = false;
var options = new OptionSet() {
{
"h", "Show help",
v => showHelp = true
}, {
"config", "Reconfigure the launcher with different settings",
v => PromptConfig()
}, {
"v", "Show current version",
v => ShowVersion()
}, {
"launch",
v => LaunchApplication()
}, {
"<>", //default
v => LaunchApplication()
}
};
//handle arguments
List<string> extra;
try {
extra = options.Parse (args);
}
catch (OptionException e) {
Console.Write("MyApp:");
Console.WriteLine(e.Message);
Console.WriteLine("Try `MyApp--help' for more information");
return;
}
if (showHelp) {
ShowHelp(options);
return;
}
}