|
|
@ -2,8 +2,9 @@ package cli_test
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"flag"
|
|
|
|
"github.com/codegangsta/cli"
|
|
|
|
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/codegangsta/cli"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func TestCommandDoNotIgnoreFlags(t *testing.T) {
|
|
|
|
func TestCommandDoNotIgnoreFlags(t *testing.T) {
|
|
|
@ -14,12 +15,12 @@ func TestCommandDoNotIgnoreFlags(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
c := cli.NewContext(app, set, set)
|
|
|
|
c := cli.NewContext(app, set, set)
|
|
|
|
|
|
|
|
|
|
|
|
command := cli.Command {
|
|
|
|
command := cli.Command{
|
|
|
|
Name: "test-cmd",
|
|
|
|
Name: "test-cmd",
|
|
|
|
ShortName: "tc",
|
|
|
|
ShortName: "tc",
|
|
|
|
Usage: "this is for testing",
|
|
|
|
Usage: "this is for testing",
|
|
|
|
Description: "testing",
|
|
|
|
Description: "testing",
|
|
|
|
Action: func(_ *cli.Context) { },
|
|
|
|
Action: func(_ *cli.Context) {},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
err := command.Run(c)
|
|
|
|
err := command.Run(c)
|
|
|
|
|
|
|
|
|
|
|
@ -34,12 +35,12 @@ func TestCommandIgnoreFlags(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
c := cli.NewContext(app, set, set)
|
|
|
|
c := cli.NewContext(app, set, set)
|
|
|
|
|
|
|
|
|
|
|
|
command := cli.Command {
|
|
|
|
command := cli.Command{
|
|
|
|
Name: "test-cmd",
|
|
|
|
Name: "test-cmd",
|
|
|
|
ShortName: "tc",
|
|
|
|
ShortName: "tc",
|
|
|
|
Usage: "this is for testing",
|
|
|
|
Usage: "this is for testing",
|
|
|
|
Description: "testing",
|
|
|
|
Description: "testing",
|
|
|
|
Action: func(_ *cli.Context) { },
|
|
|
|
Action: func(_ *cli.Context) {},
|
|
|
|
SkipFlagParsing: true,
|
|
|
|
SkipFlagParsing: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
err := command.Run(c)
|
|
|
|
err := command.Run(c)
|
|
|
|