From bed468fb766d264d983dbcceea530350ae28e812 Mon Sep 17 00:00:00 2001 From: Alberts Zemzale Date: Thu, 13 Aug 2020 19:15:35 +0300 Subject: [PATCH 1/2] Fix v1 aliases syntax in v2 docs --- docs/v2/manual.md | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/docs/v2/manual.md b/docs/v2/manual.md index c39bfb9..fea20ec 100644 --- a/docs/v2/manual.md +++ b/docs/v2/manual.md @@ -425,14 +425,17 @@ import ( func main() { app := &cli.App{ Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "lang, l", - Value: "english", - Usage: "Language for the greeting", - }, - &cli.StringFlag{ - Name: "config, c", - Usage: "Load configuration from `FILE`", + &cli.StringFlag{ + Name: "lang", + Aliases: []string{"l"}, + Value: "english", + Usage: "Language for the greeting", + }, + &cli.StringFlag{ + Name: "config", + Aliases: []string{"c"}, + Usage: "Load configuration from `FILE`", + }, }, }, Commands: []*cli.Command{ @@ -570,7 +573,8 @@ func main() { app.Flags = []cli.Flag { &cli.StringFlag{ - Name: "password, p", + Name: "password", + Aliases: []string{"p"}, Usage: "password for the mysql database", FilePath: "/etc/mysql/password", }, @@ -1309,7 +1313,8 @@ import ( func main() { cli.HelpFlag = &cli.BoolFlag{ - Name: "haaaaalp", Aliases: []string{"halp"}, + Name: "haaaaalp", + Aliases: []string{"halp"}, Usage: "HALP", EnvVars: []string{"SHOW_HALP", "HALPPLZ"}, } @@ -1344,7 +1349,8 @@ import ( func main() { cli.VersionFlag = &cli.BoolFlag{ - Name: "print-version", Aliases: []string{"V"}, + Name: "print-version", + Aliases: []string{"V"}, Usage: "print only the version", } From d2739475928a1a62b41c45506278ddd700517ddc Mon Sep 17 00:00:00 2001 From: Alberts Zemzale Date: Sun, 23 Aug 2020 13:35:59 +0300 Subject: [PATCH 2/2] Remove incorrect bracket in v2 docs example --- docs/v2/manual.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/v2/manual.md b/docs/v2/manual.md index fea20ec..266abd5 100644 --- a/docs/v2/manual.md +++ b/docs/v2/manual.md @@ -436,7 +436,6 @@ func main() { Aliases: []string{"c"}, Usage: "Load configuration from `FILE`", }, - }, }, Commands: []*cli.Command{ {