From c1c8825a460d1440306cb6875ec9d3a9be36a93e Mon Sep 17 00:00:00 2001 From: Kevin Cantwell Date: Mon, 25 Apr 2016 10:50:29 -0400 Subject: [PATCH] updates README with flag usage placeholder instructions --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index d9371cf..524723e 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,27 @@ app.Action = func(c *cli.Context) { See full list of flags at http://godoc.org/github.com/codegangsta/cli +#### Placeholder Values + +Sometimes it's useful to specify a flag's value within the usage string itself. Such placeholders are +indicated with back quotes. + +For example this: +```go +cli.StringFlag{ + Name: "config, c", + Usage: "Load configuration from `FILE`", +} +``` + +Will result in help output like: + +``` +--config FILE, -c FILE Load configuration from FILE +``` + +Note that only the first placeholder is used. Subsequent back-quoted words will be left as-is. + #### Alternate Names You can set alternate (or short) names for flags by providing a comma-delimited list for the `Name`. e.g.