Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alimy/cli
Sample cli application code layout base on go module style.
https://github.com/alimy/cli
go sample
Last synced: 28 days ago
JSON representation
Sample cli application code layout base on go module style.
- Host: GitHub
- URL: https://github.com/alimy/cli
- Owner: alimy
- License: apache-2.0
- Created: 2018-12-27T10:56:44.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-27T12:01:24.000Z (almost 6 years ago)
- Last Synced: 2024-04-16T17:41:53.531Z (7 months ago)
- Topics: go, sample
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Sample code layout for cli application use go module style
### Usage
```$bash
$ git clone https://github.com/alimy/cli
$ cd cli
$ make$ ./cli
a sample cli application base on go module styleUsage:
cli [command]Available Commands:
hello sample sub-command for cli
help Help about any command
version version of applicationFlags:
-h, --help help for cliUse "cli [command] --help" for more information about a command.
$ ./cli version
0.0.0 (APIVersion:v1alphal)
BuildTime:2018-12-27 11:58:13 UTC
BuildGitSHA:6f61a2376753e270b943d5ab63eaeb85357b8486$ ./cli hello
2018-12-27T20:00:06.390+0800 INFO [email protected]/hello.go:6 hello world!
```### Custom your code base this repository
* change module name and others
* add sub-module in module directory
* import sub-module in main.go to register sub-command
* and so on...