How do I print the help screen?
See original GitHub issueIssue by ptr727 Tuesday May 23, 2017 at 17:02 GMT _Originally opened as https://github.com/gsscoder/commandline/issues/445_
How do I print the help output I’ve evaluated the logical options and something is wrong?
// Parse the commandline arguments
// https://github.com/gsscoder/commandline
Parser parser = new Parser(with =>
{
with.CaseSensitive = false;
with.HelpWriter = Console.Error;
});
ParserResult<Options> result = parser.ParseArguments<Options>(args);
if (result.Tag == ParserResultType.NotParsed)
{
return -1;
}
Options options = ((Parsed<Options>)result).Value;
// Process or monitor must be specified
if (options.ProcessFolders == false && options.MonitorFolders == false)
{
// TODO : Call help output directly
return -1;
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
How Do I Print Screen On My PC | HP® Tech Takes
Press the main Win key and PrtSc at the same time. This will take a screenshot of the entire current screen. The screen...
Read more >Copy the window or screen contents
Click the window that you want to copy. Press ALT+PRINT SCREEN. Paste (CTRL+V) the image into an Office program or other application.
Read more >Print Anything You See on Your Screen – Video Tip
Open your favorite word processor (if you are using Word, sometimes it needs to be open before you hit the Print Screen button)....
Read more >How to Print Your Screen in 3 Easy Steps
Open the “Pictures/Screenshots” folder in your user profile and double-click your screenshot. Press “File” and then “Print”.
Read more >Printing HELP Screens
When you display HELP files, you can get a printed copy of the screen by pressing PA2 while the screen is displayed. To...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Comment by veleek Tuesday Jul 25, 2017 at 23:23 GMT
I believe that this is definitely a bug in the code. If you use the overload of
AutoBuild(...)
that takesonError
andonExample
functions then it will write successfully.It actually has an explicit block in the code which checks whether or not the
ParserResult<T>
being passed in is a NotParsed result in which case it gracefully attempts to write the error output.So, as a workaround in the meantime you can just use
The above workaround does not work for me (throws a NullReferenceException, using CommandLineParser 2.6.0), however only a simple change was needed to make it work: