flag
flag copied to clipboard
专为命令行爱好者设计,方便写出类似于git或者coreutils中的命令接口(ls, mv, cat),新用户建议使用https://github.com/guonaihong/clop
Results
3
flag issues
Sort by
recently updated
recently updated
newest added
这样可以提醒使用者,哪些选项是必须要写的 触发条件,某个选项设置打开了must函数,没有在命令行里填入该值又没有默信值的情况下,则标红该usage信息。伪代码如下 ```go flag.Opt("i, int", "test int").Must().Var(&option.Int, 0) ```
v0.0.1
现在代码里面,每加一种类型都要实现如下接口 ```go type Value interface { String() string Set(string) error } ``` 这种代码无趣,还很容易出错。有没有方法生产各种类型,实现这种接口代码
#9