mow.cli:在Go中构建CLI应用程序的多功能库

时间:2021-02-01 10:25:24
【文件属性】:
文件名称:mow.cli:在Go中构建CLI应用程序的多功能库
文件大小:90KB
文件格式:ZIP
更新时间:2021-02-01 10:25:24
go cli command-line CommandlineinterfaceGo cli 软件包cli提供了一个框架,用于在Go中构建命令行应用程序,大部分参数解析和验证的负担都放在框架上而不是用户身上。 入门 以下示例演示了该软件包的基本用法。 简易申请 在这个简单的应用程序中,我们模仿标准UNIX cp命令的参数解析。 我们的应用程序要求用户指定一个或多个源文件,然后指定目标。 可以提供可选的递归标志。 package main import ( "fmt" "os" "github.com/jawher/mow.cli" ) func main () { // create an app app := cli . App ( "cp" , "Copy files around" ) // Here's what differentiates mow.cli from other CLI libraries: // This line is not just for help message generation. // It also validates the call to reject calls with less than 2 a
【文件预览】:
mow.cli-master
----.goreleaser.yml(161B)
----.gitignore(90B)
----go.mod(173B)
----doc.go(27KB)
----Makefile(477B)
----args.go(14KB)
----var_test.go(3KB)
----LICENSE(1KB)
----examples_test.go(6KB)
----go.sum(1KB)
----testdata()
--------help-output-top-help-i-user.txt(2KB)
--------help-output-command4.txt(43B)
--------multi-line-desc-help-output.txt(423B)
--------help-output-top-help.txt(2KB)
--------help-output-command3-child1.txt(110B)
--------long-help-output.txt(148B)
--------help-output-command2.txt(43B)
--------help-output-command3.txt(211B)
--------help-output-command1.txt(43B)
--------help-output-command3-child2.txt(114B)
--------help-output-top-help-i-env.txt(2KB)
----.github()
--------workflows()
----README.md(37KB)
----examples_varopt_test.go(829B)
----README.md.template(10KB)
----commands.go(21KB)
----options.go(18KB)
----.golangci.yml(91B)
----cli.go(3KB)
----examples_vararg_test.go(759B)
----errors.go(150B)
----cli_test.go(59KB)
----internal()
--------lexer()
--------flow()
--------matcher()
--------container()
--------parser()
--------values()
--------fsm()
----commands_test.go(30KB)

网友评论