alecthomas / alecthomas/kong

Return an error if flag is provided twice

Aperta
#441 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
3.2k
Fork
188
Merge medio
1g 1h
PR unite (30g)
2

Descrizione

I had an issue that I made a mistake and instead of:

```
program -o /path --out .ext
```

I wrote:

```
program -o /path -out .ext
```

And was confused why is program writing out to "ut.ext" directory instead to `/path`. Is there a way to request kong to fail CLI parsing if a flag is provided twice? So for use cases like `-vvv` with counters this might be reasonable. And when field type is a slice. But providing multiple flags when field type is not a slice should return an error and not just that later flag silently overrides a prior flag. Or at least there should be an option to control this. What do you think?

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.