minio/cmd/new-cmd/README.md

26 lines
740 B
Markdown
Raw Normal View History

2014-12-18 02:18:02 -08:00
## Introduction
`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
You just need to set its command name and options:
2014-12-18 02:18:02 -08:00
```bash
$ new-cmd --options option1,option2,option3 --usage "This command is best" [commandname]
2014-12-18 02:18:02 -08:00
```
Generates three files [commandname].go, [commandname]-options.go, [commandname].md respectively
2014-12-18 02:18:02 -08:00
## Example
If you want to start to building `bucket` command which has options `get`, `put`, `list`:
2014-12-18 02:18:02 -08:00
```bash
$ 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
```