{"repo":"guonaihong/clop","free":true,"listed":false,"github":"https://github.com/guonaihong/clop","clone":"git clone https://github.com/guonaihong/clop.git","description":"^=^ clop是基于struct的命令行解析库，专注是它的灵魂，像AK47一样，简单，强大，专注，让命令行里面的疑难杂症统统走开[从零实现]","language":"Go","stars":132,"topics":["command-line","subcommand","cli","env","argparse"],"license":"Apache-2.0","category":"cli-tools","readme_excerpt":"clop clop (Command Line Option Parse)是一款基于struct的命令行解析器，麻雀虽小，五脏俱全(从零实现)。 feature 支持环境变量绑定 支持参数搜集 ，可以把 散装成员归归类，收集到你指定的结构体成员里 支持短选项 或者长选项 不在话下 posix风格命令行支持，支持命令组合 是 简写形式，方便实现普通posix 标准命令 子命令( )支持，方便实现git风格子命令 ，简洁的子命令注册方式，只要会写结构体就行，3,4,5到无穷尽子命令也支持，只要你喜欢，用上clop就可以实现 默认值支持 ，支持多种数据类型，让你省去类型转换的烦恼 贴心的重复命令报错 严格的短选项，长选项报错。避免二义性选项诞生 效验模式支持，不需要写一堆的 or 浪费青春的代码 可以获取命令优先级别，方便设置命令别名 解析flag包代码生成clop代码 指定 解析 函数， 自动绑定数据 内容 - Installation - Quick start - example - base type - int - float64 - time.Duration - string - array - similar to curl command - similar to join command - 1. How to use required tags - 2. Support environment variables - 2.1 Custom environment variable name - 2.2 Quick writing of environment variables - 3. Set default value - 4. How to implement git style commands - 4.1 Sub command implementation method 1 - 4.2 Sub command implementation method 2 - 5. Get command priority - 6. Can only be set once - 7. Quick write - 8. Multi structure series - 9. Support callback function parsing - Advanced features - Parsing flag code to generate clop code - Implementing linux command options - cat - faq - The subcommand or option does not take effect Installation Quick start example base type int float64 duration string array similar to curl command similar to join command 加上greedy属性，就支持数组贪婪写法。类似join命令。 required flag set default value 可以使用default tag设置默认值，普通类型直接写，复合类型用json表示 Support environment variables custom environment variable name Quick writing of environment variables 使用env tag会根据结构体名,","default_branch":null,"files":null,"tree":[],"storefront":"/r/guonaihong","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/guonaihong/clop/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}