File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -25,33 +25,37 @@ type (
2525)
2626
2727var (
28- defaultFlags = & Command {
29- Use : "app" ,
30- DisableSuggestions : false ,
28+ defaultFlags = & CommandNode {
29+ Name : "app" ,
30+ Command : & Command {
31+ Use : "app" ,
32+ DisableSuggestions : false ,
33+ },
34+ Flags : nil ,
3135 }
3236 bucket = & storage {
3337 instances : sync.Map {},
3438 }
3539)
3640
37- func NewRootCommand (c * Command ) {
41+ func NewRootCommand (c * CommandNode ) {
3842 defaultFlags = c
3943}
4044
4145func Register (fs ... CommandNode ) {
4246 RegisterSpecify (defaultFlags , fs ... )
4347}
4448
45- func RegisterSpecify (commend * Command , fs ... CommandNode ) {
49+ func RegisterSpecify (cnd * CommandNode , fs ... CommandNode ) {
4650 for _ , c := range fs {
4751 c .Flags (c .Command )
48- commend .AddCommand (c .Command )
52+ cnd . Command .AddCommand (c .Command )
4953 bucket .instances .Store (c .Name , c .Command )
5054 }
5155}
5256
5357func Parse () error {
54- return defaultFlags .Execute ()
58+ return defaultFlags .Command . Execute ()
5559}
5660
5761func NString (nodeName , name string ) string {
You can’t perform that action at this time.
0 commit comments