Skip to content

Commit 9a726c8

Browse files
committed
Small adjustment
1 parent 68154de commit 9a726c8

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

‎cobrakai.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func R(command Commander, wcs ...WithCommandeer) (Executer, error) {
9898
}
9999

100100
// C creates nested commands.
101-
func C(command Commander, wcs ...WithCommandeer) func(*Commandeer) {
101+
func C(command Commander, wcs ...WithCommandeer) WithCommandeer {
102102
return func(parent *Commandeer) {
103103
cd := &Commandeer{
104104
Command: command,

‎cobrakai_test.go‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ func TestCobraKai(t *testing.T) {
2121

2222
c := qt.New(t)
2323
r, err := cobrakai.R(
24-
&testComand1{name: "hugo"},
25-
cobrakai.C(fooCommand,
26-
cobrakai.C(fooBazCommand),
24+
&testComand1{name: "hugo"}, // The root command.
25+
cobrakai.C(
26+
fooCommand,
27+
cobrakai.C(
28+
fooBazCommand),
2729
),
2830
cobrakai.C(barCommand),
2931
)

‎go.mod‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ module github.com/bep/cobrakai
22

33
go 1.20
44

5-
require github.com/frankban/quicktest v1.14.2
5+
require (
6+
github.com/frankban/quicktest v1.14.2
7+
github.com/spf13/cobra v1.7.0
8+
github.com/spf13/pflag v1.0.5
9+
)
610

711
require (
812
github.com/google/go-cmp v0.5.7 // indirect
913
github.com/inconshreveable/mousetrap v1.1.0 // indirect
1014
github.com/kr/pretty v0.3.0 // indirect
1115
github.com/kr/text v0.2.0 // indirect
1216
github.com/rogpeppe/go-internal v1.6.1 // indirect
13-
github.com/spf13/cobra v1.7.0 // indirect
14-
github.com/spf13/pflag v1.0.5 // indirect
1517
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
1618
)

0 commit comments

Comments
 (0)