File tree Expand file tree Collapse file tree 8 files changed +20
-20
lines changed
Expand file tree Collapse file tree 8 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,13 @@ import (
2626)
2727
2828type blotCmd struct {
29- subCmd
29+ verb
3030 offsets * bool
3131}
3232
3333func newBlotCmd () * blotCmd {
3434 cmd := & blotCmd {
35- subCmd : subCmd {name : "blot" , flags : flag .NewFlagSet ("blot" , flag .ExitOnError )}}
35+ verb : verb {name : "blot" , flags : flag .NewFlagSet ("blot" , flag .ExitOnError )}}
3636 cmd .offsets = cmd .flags .Bool ("offsets" , false , "show text position of blots" )
3737 return cmd
3838}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import (
2828
2929// TBD: write and use newIndex(), newExtract()
3030// instead of init() ugliness
31- var scMap = map [string ]SubCmd {
31+ var scMap = map [string ]Verb {
3232 "index" : newIndexCmd (),
3333 "extract" : newExtractCmd (),
3434 "blot" : newBlotCmd (),
@@ -60,7 +60,7 @@ func getIndexRoot() string {
6060func splitArgs (args []string ) ([]string , []string ) {
6161 var i int
6262 var arg string
63- var sc SubCmd
63+ var sc Verb
6464 for i , arg = range args {
6565 sc = scMap [arg ]
6666 if sc != nil {
Original file line number Diff line number Diff line change @@ -27,14 +27,14 @@ import (
2727)
2828
2929type extractCmd struct {
30- subCmd
30+ verb
3131 index * dupi.Index
3232 json * bool
3333 sigma * float64
3434}
3535
3636func newExtractCmd () * extractCmd {
37- var extract = & extractCmd {subCmd : subCmd {
37+ var extract = & extractCmd {verb : verb {
3838 name : "extract" ,
3939 usage : "extract [args]" ,
4040 flags : flag .NewFlagSet ("extract" , flag .ExitOnError )}}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import (
2727)
2828
2929type indexCmd struct {
30- subCmd
30+ verb
3131 shards * int
3232 seqlen * int
3333 add * bool
@@ -38,7 +38,7 @@ type indexCmd struct {
3838
3939func newIndexCmd () * indexCmd {
4040 var index = & indexCmd {
41- subCmd : subCmd {
41+ verb : verb {
4242 name : "index" ,
4343 flags : flag .NewFlagSet ("index" , flag .ExitOnError )}}
4444 index .seqlen = index .flags .Int ("t" , 10 , "similarity based seq len" )
Original file line number Diff line number Diff line change @@ -25,17 +25,17 @@ import (
2525)
2626
2727type inspectCmd struct {
28- subCmd
28+ verb
2929 json * bool
3030 files * bool
3131}
3232
3333func newInspectCmd () * inspectCmd {
34- sub := & subCmd {
34+ sub := & verb {
3535 name : "inspect" ,
3636 flags : flag .NewFlagSet ("inspect" , flag .ExitOnError )}
3737 res := & inspectCmd {
38- subCmd : * sub ,
38+ verb : * sub ,
3939 json : sub .flags .Bool ("json" , false , "output json." ),
4040 files : sub .flags .Bool ("files" , false , "output file info." )}
4141 return res
Original file line number Diff line number Diff line change @@ -27,12 +27,12 @@ import (
2727)
2828
2929type likeCmd struct {
30- subCmd
30+ verb
3131}
3232
3333func newLikeCmd () * likeCmd {
34- sc := & subCmd {flags : flag .NewFlagSet ("like" , flag .ExitOnError )}
35- lc := & likeCmd {subCmd : * sc }
34+ sc := & verb {flags : flag .NewFlagSet ("like" , flag .ExitOnError )}
35+ lc := & likeCmd {verb : * sc }
3636 return lc
3737}
3838
Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ import (
2323)
2424
2525type unblotCmd struct {
26- subCmd
26+ verb
2727 all * bool
2828}
2929
3030func newUnblotCmd () * unblotCmd {
3131 cmd := & unblotCmd {
32- subCmd : subCmd {name : "unblot" , flags : flag .NewFlagSet ("unblot" , flag .ExitOnError )}}
32+ verb : verb {name : "unblot" , flags : flag .NewFlagSet ("unblot" , flag .ExitOnError )}}
3333 cmd .all = cmd .flags .Bool ("all" , false , "output all matches" )
3434 return cmd
3535}
Original file line number Diff line number Diff line change @@ -5,23 +5,23 @@ package main
55
66import "flag"
77
8- type SubCmd interface {
8+ type Verb interface {
99 Name () string
1010 Flags () * flag.FlagSet
1111 Run (args []string ) error
1212 Usage () string
1313}
1414
15- type subCmd struct {
15+ type verb struct {
1616 name string
1717 flags * flag.FlagSet
1818 usage string
1919}
2020
21- func (s * subCmd ) Name () string {
21+ func (s * verb ) Name () string {
2222 return s .name
2323}
2424
25- func (s * subCmd ) Flags () * flag.FlagSet {
25+ func (s * verb ) Flags () * flag.FlagSet {
2626 return s .flags
2727}
You can’t perform that action at this time.
0 commit comments