3

Clerc:一个轻量但强大的命令行框架

 1 year ago
source link: https://mk1.io/posts/hey-clerc
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Clerc:一个轻量但强大的命令行框架

 2022.12.21 2022.12.21 开发 1011

Clerc项目地址:https://github.com/so1ve/clerc

感觉Clerc写的很牛逼啊,啥功能都有(大嘘

功能列表:

  • 高度可定制
  • 高度解耦,功能大部分可通过插件实现
  • 链式API
  • 子命令 + 嵌套命令
  • 可切换的单命令 / 多命令模式
  • 自动映射参数
  • 强类型参数、Flag
  • 把Flag转换为驼峰命名
  • 通过plugin-help实现自动生成的帮助
  • 通过plugin-completions实现自动补全
  • 通过plugin-not-found实现在命令未找到的时候给出最接近的命令(即Did you mean
  • 通过plugin-version实现输出版本的命令,及传入--version-V(可自定义)时输出版本号
  • 通过plugin-strict-flags实现在传入多余 / 未定义参数时报错
  • 通过plugin-friendly-error实现错误自动美化输出
  • 以及强大的toolkit(也就是重新导出了一下几个好用的CLI工具(bushi
  • 等等等等……

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK