Skip to content

Commit

Permalink
Merge pull request #1655 from dearchap/fix_v2_docs
Browse files Browse the repository at this point in the history
Fix v2 docs
  • Loading branch information
dearchap committed Jan 22, 2023
2 parents 9d6c243 + eb9e5d5 commit 60921ef
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/v2/examples/flags.md
Expand Up @@ -245,7 +245,7 @@ import (
)

func main() {
app = &cli.App{
app := &cli.App{
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "silent",
Expand Down
7 changes: 5 additions & 2 deletions docs/v2/examples/subcommands-categories.md
Expand Up @@ -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.:

<!-- {
"output": ".*COMMANDS:\\n.*noop[ ]*\\n.*\\n[ ]*template:\\n[ ]*add[ ]*\\n[ ]*remove.*"
} -->
```go
package main

Expand Down Expand Up @@ -48,7 +51,7 @@ Will include:
COMMANDS:
noop
Template actions:
template:
add
remove
```
```
23 changes: 19 additions & 4 deletions docs/v2/examples/timestamp-flag.md
Expand Up @@ -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)
}
}
```

Expand Down

0 comments on commit 60921ef

Please sign in to comment.