diff --git a/docs/v3/examples/arguments/advanced.md b/docs/v3/examples/arguments/advanced.md deleted file mode 100644 index 2a0a681fe9..0000000000 --- a/docs/v3/examples/arguments/advanced.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -tags: - - v3 -search: - boost: 2 ---- - -Instead of the user having to look through all the arguments one by one we can also specify the argument types and destination -fields so that the value can be directly retrieved by the user. Lets go back to the greeter app and specifying the types for arguments - - -```go -package main - -import ( - "fmt" - "log" - "os" - "context" - - "github.com/urfave/cli/v3" -) - -func main() { - var name, soap string - var count int64 - var version float64 - cmd := &cli.Command{ - Arguments: []Argument{ - &StringArg{ - Name: "name", - Min: 1, - Max: 1, - Destination: &name, - }, - &IntArg{ - Name: "count", - Min: 1, - Max: 1, - Destination: &count, - }, - &StringArg{ - Name: "soap", - Min: 1, - Max: 1, - Destination: &soap, - }, - &FloatArg{ - Name: "version", - Min: 1, - Max: 1, - Destination: &version, - }, - }, - Action: func(ctx context.Context, cmd *cli.Command) error { - fmt.Printf("%s-%d-%s-%f", name, count, soap, version) - return nil - }, - } - - if err := cmd.Run(context.Background(), os.Args); err != nil { - log.Fatal(err) - } -} -``` - diff --git a/docs/v3/examples/flags/advanced.md b/docs/v3/examples/flags/advanced.md index 4c6566f8b0..49d9b63b94 100644 --- a/docs/v3/examples/flags/advanced.md +++ b/docs/v3/examples/flags/advanced.md @@ -12,7 +12,7 @@ e.g. ```go package main @@ -336,7 +336,7 @@ For example this: ```go package main diff --git a/docs/v3/examples/flags/value-sources.md b/docs/v3/examples/flags/value-sources.md index 8627396d8c..49030922b4 100644 --- a/docs/v3/examples/flags/value-sources.md +++ b/docs/v3/examples/flags/value-sources.md @@ -177,7 +177,7 @@ Here is a more complete sample of a command using YAML support: ```go package main diff --git a/docs/v3/examples/full-api-example.md b/docs/v3/examples/full-api-example.md index 7442732223..7e175a0455 100644 --- a/docs/v3/examples/full-api-example.md +++ b/docs/v3/examples/full-api-example.md @@ -22,6 +22,7 @@ import ( "io/ioutil" "os" "time" + "slices" "github.com/urfave/cli/v3" ) @@ -141,7 +142,7 @@ func main() { &cli.BoolFlag{Value: true, Name: "fancier"}, &cli.DurationFlag{Name: "howlong", Aliases: []string{"H"}, Value: time.Second * 3}, &cli.FloatFlag{Name: "howmuch"}, - &cli.IntFlag{Name: "longdistance", Validator: func (t int) error { + &cli.IntFlag{Name: "longdistance", Validator: func (t int64) error { if t < 10 { return fmt.Errorf("10 miles isnt long distance!!!!") } diff --git a/mkdocs.yml b/mkdocs.yml index 51ca24c3e0..3c09278d44 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -29,7 +29,7 @@ nav: - Advanced: v3/examples/flags/advanced.md - Arguments: - Basics: v3/examples/arguments/basics.md - - Advanced: v3/examples/arguments/advanced.md + #- Advanced: v3/examples/arguments/advanced.md - Subcommands: - Basics: v3/examples/subcommands/basics.md - Categories: v3/examples/subcommands/categories.md