18 lines
375 B
Go
18 lines
375 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os"
|
||
|
|
||
|
"git.pyer.club/kingecg/command"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
var cmd = command.NewCommand("test", "test command")
|
||
|
cmd.AddArg("arg1", "a", "arg1 description", "default value")
|
||
|
cmd.AddArg("arg2", "b", "arg2 description", "default value")
|
||
|
cmd.AddSubCommand("sub1", "sub1 description")
|
||
|
cmd.Parse(os.Args[1:])
|
||
|
fmt.Println(cmd.GetGlobalOptions())
|
||
|
}
|