alecthomas / kingpin

CONTRIBUTIONS ONLY: A Go (golang) command line and flag parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

choices

keith6014 opened this issue · comments

What is the preferred way to implment choices similar to argparse in python (https://docs.python.org/3/library/argparse.html#choices)

You want Enum().

Thanks for the prompt response.

I am doing

app.Flag("color","red,blue").Short('c').Enum("red","blue")

Is there a way to auto generate "red blue" when I do --help instead of putting in Flag()?

Alas, no.

Got it. That would be a nice feature.