2014-12-18 02:18:02 -08:00
|
|
|
## Introduction
|
|
|
|
|
2014-12-29 22:07:05 -08:00
|
|
|
`new-cmd` is a stub builder for new commands,options on top of [codegangsta/cli](https://github.com/codegangsta/cli),
|
2014-12-18 02:18:02 -08:00
|
|
|
|
2014-12-20 09:09:35 -08:00
|
|
|
Idea behind providing a simple tool for rapid prototyping and encouraging new contributors to the project
|
2014-12-18 02:18:02 -08:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2014-12-19 00:16:41 -08:00
|
|
|
You just need to set its command name and options:
|
2014-12-18 02:18:02 -08:00
|
|
|
|
|
|
|
```bash
|
2014-12-29 22:07:05 -08:00
|
|
|
$ new-cmd --options option1,option2,option3 --usage "This command is best" [commandname]
|
2014-12-18 02:18:02 -08:00
|
|
|
```
|
|
|
|
|
2014-12-29 22:07:05 -08:00
|
|
|
Generates three files [commandname].go, [commandname]-options.go, [commandname].md respectively
|
2014-12-18 02:18:02 -08:00
|
|
|
|
|
|
|
## Example
|
|
|
|
|
2014-12-19 00:16:41 -08:00
|
|
|
If you want to start to building `bucket` command which has options `get`, `put`, `list`:
|
2014-12-18 02:18:02 -08:00
|
|
|
|
|
|
|
```bash
|
2014-12-29 22:07:05 -08:00
|
|
|
$ new-cmd --options get,put,list --usage "Bucket operations" bucket
|
2014-12-20 09:09:35 -08:00
|
|
|
$ ls bucket/
|
|
|
|
bucket-options.go bucket.go bucket.md
|
2014-12-18 02:18:02 -08:00
|
|
|
```
|