Improve readability of README

Improve punctuation, fix capitalization in a couple of places and
rephrase some sentences for better readability.
This commit is contained in:
Johanan Lieberman 2017-06-23 20:34:30 +03:00 committed by Albert Nigmatzianov
parent e458bb7ab8
commit d638dcb7c7

View file

@ -140,8 +140,8 @@ import "github.com/spf13/cobra"
# Getting Started # Getting Started
While you are welcome to provide your own organization, typically a Cobra based While you are welcome to provide your own organization, typically a Cobra-based
application will follow the following organizational structure. application will follow the following organizational structure:
``` ```
▾ appName/ ▾ appName/
@ -153,7 +153,7 @@ application will follow the following organizational structure.
main.go main.go
``` ```
In a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra. In a Cobra app, typically the main.go file is very bare. It serves one purpose: initializing Cobra.
```go ```go
package main package main
@ -219,7 +219,8 @@ cobra add create -p 'configCmd'
Otherwise, you will encounter errors. Otherwise, you will encounter errors.
For example, `cobra add add-user` is incorrect, but `cobra add addUser` is valid.* For example, `cobra add add-user` is incorrect, but `cobra add addUser` is valid.*
Once you have run these three commands you would have an app structure that would look like: Once you have run these three commands you would have an app structure similar to
the following:
``` ```
▾ app/ ▾ app/
@ -232,14 +233,14 @@ Once you have run these three commands you would have an app structure that woul
At this point you can run `go run main.go` and it would run your app. `go run At this point you can run `go run main.go` and it would run your app. `go run
main.go serve`, `go run main.go config`, `go run main.go config create` along main.go serve`, `go run main.go config`, `go run main.go config create` along
with `go run main.go help serve`, etc would all work. with `go run main.go help serve`, etc. would all work.
Obviously you haven't added your own code to these yet, the commands are ready Obviously you haven't added your own code to these yet. The commands are ready
for you to give them their tasks. Have fun! for you to give them their tasks. Have fun!
### Configuring the cobra generator ### Configuring the cobra generator
The cobra generator will be easier to use if you provide a simple configuration The Cobra generator will be easier to use if you provide a simple configuration
file which will help you eliminate providing a bunch of repeated information in file which will help you eliminate providing a bunch of repeated information in
flags over and over. flags over and over.
@ -269,7 +270,7 @@ You can also use built-in licenses. For example, **GPLv2**, **GPLv3**, **LGPL**,
## Manually implementing Cobra ## Manually implementing Cobra
To manually implement cobra you need to create a bare main.go file and a RootCmd file. To manually implement Cobra you need to create a bare main.go file and a RootCmd file.
You will optionally provide additional commands as you see fit. You will optionally provide additional commands as you see fit.
### Create the root command ### Create the root command