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

This commit is contained in:
Dan Buch 2022-05-18 22:19:53 -04:00
parent 1080737931
commit 58842504c4
Signed by: meatballhat
GPG Key ID: A12F782281063434
3 changed files with 11 additions and 4 deletions

View File

@ -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"`
}

View File

@ -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)

View File

@ -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)