Golang 实现的命令行解析器 clop v0.0.4版本发布

项目地址

https://gitee.com/guonaihong/clop

https://github.com/guonaihong/clop

changlog

可以控制选项只能被设置一次

package main

import (
    "github.com/guonaihong/clop"
)

type Once struct {
    Debug bool `clop:"-d; --debug; once" usage:"debug mode"`
}

func main() {
    o := Once{}
    clop.Bind(&o)
}
/*
./once -debug -debug
error: The argument '-d' was provided more than once, but cannot be used multiple times
For more information try --help
*/

#35 -h; --help选项可以被重载

猜你喜欢

转载自www.oschina.net/news/115109/clop-0-0-4-released