commandlineparser / commandlineparser/commandline

Showing help with no arguments when you have a default verb

Aperta
#748 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
4.8k
Fork
478
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I want to show the verbs help when you provide no arguments:

`tool` --> Shows verbs help.
`tool arg1 arg2` --> Executes default verb with those args.

By default, it either executes the default verb without arguments or, if this verb has required values, it shows the error and help for that verb.

My current workaround is this one, but I wonder if there is a neater way:

```csharp
if (args.Length == 0)
{
args = new[] { "--help" };
}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.