Tendermint也使用了Cobra工具,Cobra跟Viper是兄弟关系的,都是spf13下面的项目,摘下github上的描述
(spf13何许人也,这么牛逼,写了这么多开源工具。
看了下简介应该是google golang团队的大牛,这些工具也都是基于go语言开发的)
https://github.com/spf13/cobra
Cobra is a library providing a simple interface to create powerful modern CLI interfaces similar to git & go tools.
Cobra is also an application that will generate your application scaffolding to rapidly develop a Cobra-based application.
Cobra provides:
Easy subcommand-based CLIs: app server, app fetch, etc.
Fully POSIX-compliant flags (including short & long versions)
Nested subcommands
Global, local and cascading flags
Easy generation of applications & commands with cobra init appname & cobra add cmdname
Intelligent suggestions (app srver... did you mean app server?)
Automatic help generation for commands and flags
Automatic help flag recognition of -h, --help, etc.
Automatically generated bash autocomplet

Cobra是spf13项目下的一个用于创建现代CLI应用的库,与Viper相关。它简化了命令行接口的创建,类似Git和Go工具。通过定义和添加command,结合flag和value,能够方便地处理命令行输入。Cobra使得处理CLI命令变得更加高效,是开发中的实用工具。
最低0.47元/天 解锁文章
762

被折叠的 条评论
为什么被折叠?



