命令行程序示例集

mkideal · · 3430 次点击 · 开始浏览    置顶
这是一个创建于 的主题,其中的信息可能已经有所发展或是发生改变。

[**CLI**](https://github.com/mkideal/cli)是一个非常小巧,便于使用且功能丰富的用于构建命令行程序的库。为了让大家更加容易上手,特此撰写了二十几个程序示例。每个示例都非常简单,通常只用来阐明一个特性的使用方法。 * [Example 1: Hello world](http://www.mkideal.com/golang/cli-examples.html#example-1-hello) * [Example 2: How to use **flag**](http://www.mkideal.com/golang/cli-examples.html#example-2-flag) * [Example 3: How to use **required** flag](http://www.mkideal.com/golang/cli-examples.html#example-3-required-flag) * [Example 4: How to use **default** flag](http://www.mkideal.com/golang/cli-examples.html#example-4-default-flag) * [Example 5: How to use **slice**](http://www.mkideal.com/golang/cli-examples.html#example-5-slice) * [Example 6: How to use **map**](http://www.mkideal.com/golang/cli-examples.html#example-6-map) * [Example 7: Usage of **force** flag](http://www.mkideal.com/golang/cli-examples.html#example-7-force-flag) * [Example 8: Usage of **child command**](http://www.mkideal.com/golang/cli-examples.html#example-8-child-command) * [Example 9: **Auto help**](http://www.mkideal.com/golang/cli-examples.html#example-9-auto-help) * [Example 10: Usage of **Validator**](http://www.mkideal.com/golang/cli-examples.html#example-10-usage-of-validator) * [Example 11: **Prompt** and **Password**](http://www.mkideal.com/golang/cli-examples.html#example-11-prompt-and-password) * [Example 12: How to use **Decoder**](http://www.mkideal.com/golang/cli-examples.html#example-12-decoder) * [Example 13: Builtin Decoder: **PidFile**](http://www.mkideal.com/golang/cli-examples.html#example-13-pid-file) * [Example 14: Builtin Decoder: **Time** and **Duration**](http://www.mkideal.com/golang/cli-examples.html#example-14-time-and-duration) * [Example 15: Builtin Decoder: **File**](http://www.mkideal.com/golang/cli-examples.html#example-15-file) * [Example 16: **Parser**](http://www.mkideal.com/golang/cli-examples.html#example-16-parser) * [Example 17: Builtin Parser: **JSONFileParser**](http://www.mkideal.com/golang/cli-examples.html#example-17-json-file) * [Example 18: How to use **custom parser**](http://www.mkideal.com/golang/cli-examples.html#example-18-custom-parser) * [Example 19: How to use **Hooks**](http://www.mkideal.com/golang/cli-examples.html#example-19-hooks) * [Example 20: How to use **Daemon**](http://www.mkideal.com/golang/cli-examples.html#example-20-daemon) * [Example 21: How to use **Editor**](http://www.mkideal.com/golang/cli-examples.html#example-21-editor) * [Example 22: Custom **Editor**](http://www.mkideal.com/golang/cli-examples.html#example-22-custom-editor)

有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

3430 次点击  ∙  1 赞  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传