natemcmaster / CommandLineUtils

Command line parsing and utilities for .NET

Home Page:https://natemcmaster.github.io/CommandLineUtils/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an option to show help text when command line empty

PaulDotNet opened this issue · comments

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
Example. I'm am trying to do [...] but [...]

When command line utility runs without any arguments it shows an error (expected) and a suggestion to use --help option.
This is what I see now:

> Myapp
The myValue field is required.
Specify --help for a list of available options and commands.

I would like to see the full help text instead of error and suggestion to use --help command.
Right now I am using a hack like this:

var myArgs = args.Length == 0 ? new string[] { "--help" } : args;

I would prefer to have an option to enable this behavior explicitly. For example like this:

var app = new CommandLineApplication();
app.HelpOption(showWhenNoArguments: true);

This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 14 days. Thank you for your contributions to this project.

Closing due to inactivity.
If you are looking at this issue in the future and think it should be reopened, please make a commented here and mention natemcmaster so he sees the notification.