diff --git a/app.go b/app.go index c5ff05a..65cbf49 100644 --- a/app.go +++ b/app.go @@ -51,7 +51,7 @@ func (a *App) Run(arguments []string) error { context := NewContext(a, set, set) if err != nil { - fmt.Println("Incorrect Usage.\n") + fmt.Printf("Incorrect Usage.\n\n") ShowAppHelp(context) fmt.Println("") return err diff --git a/app_test.go b/app_test.go index 6cc488b..f3646e9 100644 --- a/app_test.go +++ b/app_test.go @@ -14,7 +14,7 @@ func ExampleApp() { app := cli.NewApp() app.Name = "greet" app.Flags = []cli.Flag{ - cli.StringFlag{"name", "bob", "a name to say"}, + cli.StringFlag{Name: "name", Value: "bob", Usage: "a name to say"}, } app.Action = func(c *cli.Context) { fmt.Printf("Hello %v\n", c.String("name")) @@ -72,7 +72,7 @@ func TestApp_CommandWithArgBeforeFlags(t *testing.T) { command := cli.Command{ Name: "cmd", Flags: []cli.Flag{ - cli.StringFlag{"option", "", "some option"}, + cli.StringFlag{Name: "option", Value: "", Usage: "some option"}, }, Action: func(c *cli.Context) { parsedOption = c.String("option") @@ -96,8 +96,8 @@ func TestApp_ParseSliceFlags(t *testing.T) { command := cli.Command{ Name: "cmd", Flags: []cli.Flag{ - cli.IntSliceFlag{"p", &cli.IntSlice{}, "set one or more ip addr"}, - cli.StringSliceFlag{"ip", &cli.StringSlice{}, "set one or more ports to open"}, + cli.IntSliceFlag{Name: "p", Value: &cli.IntSlice{}, Usage: "set one or more ip addr"}, + cli.StringSliceFlag{Name: "ip", Value: &cli.StringSlice{}, Usage: "set one or more ports to open"}, }, Action: func(c *cli.Context) { parsedIntSlice = c.IntSlice("p") diff --git a/command.go b/command.go index 03f1c11..79af87e 100644 --- a/command.go +++ b/command.go @@ -51,7 +51,7 @@ func (c Command) Run(ctx *Context) error { } if err != nil { - fmt.Println("Incorrect Usage.\n") + fmt.Printf("Incorrect Usage.\n\n") ShowCommandHelp(ctx, c.Name) fmt.Println("") return err