flag icon indicating copy to clipboard operation
flag copied to clipboard

给帮助信息着色

Open guonaihong opened this issue 5 years ago • 0 comments

这样可以提醒使用者,哪些选项是必须要写的 触发条件,某个选项设置打开了must函数,没有在命令行里填入该值又没有默信值的情况下,则标红该usage信息。伪代码如下


flag.Opt("i, int", "test int").Must().Var(&option.Int, 0)

guonaihong avatar Jun 21 '19 13:06 guonaihong