From a093eaa8d14249119e49617923e5c4b19295791b Mon Sep 17 00:00:00 2001 From: Naveen Gogineni Date: Sun, 22 Jan 2023 16:53:48 -0500 Subject: [PATCH 1/5] Fix v2 docs --- docs/v2/examples/subcommands-categories.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/docs/v2/examples/subcommands-categories.md b/docs/v2/examples/subcommands-categories.md index 5f0b8d2e11..d0af11927a 100644 --- a/docs/v2/examples/subcommands-categories.md +++ b/docs/v2/examples/subcommands-categories.md @@ -9,6 +9,9 @@ For additional organization in apps that have many subcommands, you can associate a category for each command to group them together in the help output, e.g.: + ```go package main @@ -41,14 +44,3 @@ func main() { } } ``` - -Will include: - -``` -COMMANDS: - noop - - Template actions: - add - remove -``` From e204c5a51ed29a1ef269603f2221ee8d07eed20a Mon Sep 17 00:00:00 2001 From: Naveen Gogineni Date: Sun, 22 Jan 2023 17:01:08 -0500 Subject: [PATCH 2/5] Fix tests --- docs/v2/examples/subcommands-categories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/v2/examples/subcommands-categories.md b/docs/v2/examples/subcommands-categories.md index d0af11927a..46ddcae784 100644 --- a/docs/v2/examples/subcommands-categories.md +++ b/docs/v2/examples/subcommands-categories.md @@ -10,7 +10,7 @@ associate a category for each command to group them together in the help output, e.g.: ```go package main From 6c7fbf593e271340493029d46473c9e0ebf9ed03 Mon Sep 17 00:00:00 2001 From: Naveen Gogineni Date: Sun, 22 Jan 2023 17:06:00 -0500 Subject: [PATCH 3/5] Fix tests --- docs/v2/examples/timestamp-flag.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/v2/examples/timestamp-flag.md b/docs/v2/examples/timestamp-flag.md index 4e19adfd13..7f63a58abd 100644 --- a/docs/v2/examples/timestamp-flag.md +++ b/docs/v2/examples/timestamp-flag.md @@ -51,10 +51,25 @@ When the layout doesn't contain timezones, timestamp will render with UTC. To change behavior, a default timezone can be provided with flag definition: ```go -app := &cli.App{ - Flags: []cli.Flag{ - &cli.TimestampFlag{Name: "meeting", Layout: "2006-01-02T15:04:05", Timezone: time.Local}, - }, +package main + +import ( + "log" + "time" + "os" + "github.com/urfave/cli/v2" +) + +func main() { + app := &cli.App{ + Flags: []cli.Flag{ + &cli.TimestampFlag{Name: "meeting", Layout: "2006-01-02T15:04:05", Timezone: time.Local}, + }, + } + + if err := app.Run(os.Args); err != nil { + log.Fatal(err) + } } ``` From 03b228781e9a34946d7af8a3b02c392da47cc813 Mon Sep 17 00:00:00 2001 From: Naveen Gogineni Date: Sun, 22 Jan 2023 17:13:19 -0500 Subject: [PATCH 4/5] Fix tests --- docs/v2/examples/flags.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/v2/examples/flags.md b/docs/v2/examples/flags.md index f84fcdd7a7..f048def27c 100644 --- a/docs/v2/examples/flags.md +++ b/docs/v2/examples/flags.md @@ -245,7 +245,7 @@ import ( ) func main() { - app = &cli.App{ + app := &cli.App{ Flags: []cli.Flag{ &cli.BoolFlag{ Name: "silent", From eb9e5d5e44c52574dafa05ecea88782bfe39a814 Mon Sep 17 00:00:00 2001 From: Naveen Gogineni Date: Sun, 22 Jan 2023 17:14:23 -0500 Subject: [PATCH 5/5] Fix tests --- docs/v2/examples/subcommands-categories.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/v2/examples/subcommands-categories.md b/docs/v2/examples/subcommands-categories.md index 46ddcae784..aeddea5a92 100644 --- a/docs/v2/examples/subcommands-categories.md +++ b/docs/v2/examples/subcommands-categories.md @@ -44,3 +44,14 @@ func main() { } } ``` + +Will include: + +``` +COMMANDS: + noop + + template: + add + remove +``` \ No newline at end of file