This commit is contained in:
@@ -1,20 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"flag"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
for n, c := range commands {
|
||||
c.Register(n)
|
||||
}
|
||||
if len(os.Args) < 2 {
|
||||
flag.PrintDefaults()
|
||||
return
|
||||
}
|
||||
|
||||
for n, c := range commands {
|
||||
if os.Args[1] == n {
|
||||
c.Run()
|
||||
break
|
||||
c.Run(n)
|
||||
return
|
||||
}
|
||||
}
|
||||
fmt.Println("cmd not found")
|
||||
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user