Minor bits while giving up (for now?) on command context

urfave-cli-integration
Dan Buch 2 years ago
parent 202925ea38
commit 2af31eafe1

@ -7,10 +7,6 @@ type TypedNode struct {
Node Node `json:"node"`
}
type Args struct {
Nodes []Node `json:"nodes"`
}
type CompoundShortFlag struct {
Nodes []Node `json:"nodes"`
}

@ -15,6 +15,7 @@ func TestParser(t *testing.T) {
expPT []argh.Node
expAST []argh.Node
expErr error
skip bool
}{
{
name: "bare",
@ -306,6 +307,10 @@ func TestParser(t *testing.T) {
},
{},
} {
if tc.skip {
continue
}
if tc.expPT != nil {
t.Run(tc.name+" parse tree", func(ct *testing.T) {
actual, err := argh.ParseArgs(tc.args, tc.cfg)

@ -33,6 +33,12 @@ func TestQuerier_Program(t *testing.T) {
exp: argh.Program{},
expOK: false,
},
{
name: "invalid flag only",
args: []string{"--oh-no"},
exp: argh.Program{},
expOK: false,
},
} {
t.Run(tc.name, func(ct *testing.T) {
pt, err := argh.ParseArgs(tc.args, tc.cfg)

Loading…
Cancel
Save