command/test/main.go

21 lines
335 B
Go
Raw Normal View History

2024-11-15 13:17:19 +08:00
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)
2024-11-15 15:10:05 +08:00
err := v.Parse(os.Args[1:])
fmt.Println(sargs, err)
2024-11-15 13:17:19 +08:00
}