alecthomas / alecthomas/kong

Print usage on input without commands/args/flags

Ouverte
#33 17 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
Go
Étoiles
3.2k
Forks
188
Merge moyen
1 j 1 h
PR mergées (30 j)
2

Description

In the scenario of app invocation from terminal without _any_ command/flags
```bash
> my-app
```
I'd expect the same output of:

```bash
> my-app --help
```

Instead, I have the error about the missing command.
```bash
my-app: error: expected one of "cmd1", "cmd2"
```
Is there a way/configuration to achieve my expected outcome?

The closest function I've found is ```kong.UsageOnError()```, except it prints usage help for any error (when for any other type of error I'd expect to just print the specific error).

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.