Skip to content

Change semantics of flag place-holders in help.

Pre-release
Pre-release
Compare
Choose a tag to compare
@alecthomas alecthomas released this 19 Jun 00:57
· 317 commits to master since this release

The place-holder value for a flag is the value used in the help to describe
the value of a non-boolean flag.

The value provided to PlaceHolder() is used if provided, then the value
provided by Default() if provided, then finally the capitalised flag name is
used.

Here are some examples of flags with various permutations:

--name=NAME           // Flag(...).String()
--name="Harry"        // Flag(...).Default("Harry").String()
--name=FULL-NAME      // flag(...).PlaceHolder("FULL-NAME").Default("Harry").String()