From 37eef5912ebb5abcbba990d859509de80644edcd Mon Sep 17 00:00:00 2001 From: Jared Forsyth Date: Wed, 20 Nov 2013 00:10:52 -0800 Subject: [PATCH] add info about alternate flag names to the readme --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 3fb272c..5005a8d 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,18 @@ app.Action = func(c *cli.Context) { ... ``` +#### Alternate Names + +You can set alternate (or short) names for flags by providing a comma-delimited list for the Name. e.g. + +``` go +app.Flags = []cli.Flag { + cli.StringFlag{"lang, l", "english", "language for the greeting"}, +} +``` + +That flag can then be set with `--lang spanish` or `-l spanish`. Note that giving two different forms of the same flag in the same command invocation is an error. + ### Subcommands Subcommands can be defined for a more git-like command line app.