tsuri / cli-init

The easy way to start building Golang command-line application.

Home Page:http://tcnksm.github.io/cli-init/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cli-init Build Status Coverage Status MIT License

The easy way to start building Golang command-line application.

Description

cli-init is the easy way to start building Golang command-line application with codegangsta/cli. All you need to do is to set application name and its subcommand. cli-init generates its templates (scaffold) which you need to write when using codegangsta/cli. You can focus on core functionality of application.

Demo

Usage

You just need to set its application name:

$ cli-init [options] [application]

You can set subcommands with -s option:

$ cli-init -s subcommand1,subcommand2,subcommand3 [application]

Artifacts

cli-init generates templates (scaffold) which you need to write when using codegangsta/cli:

  • main.go - defines main function. It includes application name, version, usage, author name and so on.
  • commands.go - defines sub-commands. It includes subcommand name, usage, function and so on.
  • version.go - defines application version. default value is 0.1.0
  • README.md - insctructs application name, synopsis, usage and installation and so on.
  • CHANGELOG.md - shows version release date and its updates.

See more details codegangsta/cli.

Example

If you want to start to building todo application which has subcommands add, list, delete:

$ cli-init -s add,list,delete todo

You can see sample of artifacts in tcnksm/sample-cli-init.

Installation

To install, use go get and make install. We tag versions so feel free to checkout that tag and compile.

$ go get -d github.com/tcnksm/cli-init
$ cd $GOPATH/src/github.com/tcnksm/cli-init
$ make install 

Contribution

  1. Fork (https://github.com/tcnksm/cli-init/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create new Pull Request

Author

tcnksm

About

The easy way to start building Golang command-line application.

http://tcnksm.github.io/cli-init/

License:MIT License