command/example/test/main.go

21 lines
335 B
Go

package main
import (
"fmt"
"os"
"git.pyer.club/kingecg/command"
)
func main() {
type targs struct {
Test string `flag_default:"test" flag_usage:"this is test"`
TestBool bool `flag_short:"b"`
TestInt int
}
sargs := &targs{}
v, _ := command.NewFVSet(sargs)
err := v.Parse(os.Args[1:])
fmt.Println(sargs, err)
}