alecthomas / alecthomas/kong

[feature request] Optional `help` commands

Ouverte
#612 0 commentaires 0 réactions 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

It's very handy when a CLI prints help not only with `--help` flag, but also with `help` command. Let's add an option `WithHelpCommands()` which makes the following runs behaving the same:
```shell
my-bin foo bar --help
my-bin foo bar -h
my-bin foo bar help
my-bin --help foo bar
my-bin -h foo bar
my-bin help foo bar
```

Now, users have to manipulate args to achieve the desired:
```go
for i, arg := range os.Args[1:] {
if arg == "help" {
os.Args[1+i] = "--help"
}
}
```

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.