arghing #1

Merged
meatballhat merged 23 commits from arghing into main 2022-06-06 22:44:25 +00:00
3 changed files with 11 additions and 4 deletions
Showing only changes of commit 58842504c4 - Show all commits

View File

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

View File

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

View File

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