Merge branch 'master' into toml-support

This commit is contained in:
kandayasu 2016-07-26 16:04:44 +09:00 committed by GitHub
commit af0ac0f1f3
4 changed files with 9 additions and 8 deletions

View File

@ -5,6 +5,7 @@
## [Unreleased] ## [Unreleased]
### Added ### Added
- Flag type code generation via `go generate` - Flag type code generation via `go generate`
- Write to stderr and exit 1 if action returns non-nil error
### Changed ### Changed
- Raise minimum tested/supported Go version to 1.2+ - Raise minimum tested/supported Go version to 1.2+

View File

@ -953,7 +953,7 @@ setting `cli.VersionFlag`, e.g.:
<!-- { <!-- {
"args": ["&#45;&#45print-version"], "args": ["&#45;&#45print-version"],
"output": "partay version v19\\.99\\.0" "output": "partay version 19\\.99\\.0"
} --> } -->
``` go ``` go
package main package main
@ -972,7 +972,7 @@ func main() {
app := cli.NewApp() app := cli.NewApp()
app.Name = "partay" app.Name = "partay"
app.Version = "v19.99.0" app.Version = "19.99.0"
app.Run(os.Args) app.Run(os.Args)
} }
``` ```
@ -981,7 +981,7 @@ Alternatively, the version printer at `cli.VersionPrinter` may be overridden, e.
<!-- { <!-- {
"args": ["&#45;&#45version"], "args": ["&#45;&#45version"],
"output": "version=v19\\.99\\.0 revision=fafafaf" "output": "version=19\\.99\\.0 revision=fafafaf"
} --> } -->
``` go ``` go
package main package main
@ -1004,7 +1004,7 @@ func main() {
app := cli.NewApp() app := cli.NewApp()
app.Name = "partay" app.Name = "partay"
app.Version = "v19.99.0" app.Version = "19.99.0"
app.Run(os.Args) app.Run(os.Args)
} }
``` ```
@ -1083,7 +1083,7 @@ func (g *genericType) String() string {
func main() { func main() {
app := cli.NewApp() app := cli.NewApp()
app.Name = "kənˈtrīv" app.Name = "kənˈtrīv"
app.Version = "v19.99.0" app.Version = "19.99.0"
app.Compiled = time.Now() app.Compiled = time.Now()
app.Authors = []cli.Author{ app.Authors = []cli.Author{
cli.Author{ cli.Author{

View File

@ -93,6 +93,6 @@ func HandleExitCoder(err error) {
if err.Error() != "" { if err.Error() != "" {
fmt.Fprintln(ErrWriter, err) fmt.Fprintln(ErrWriter, err)
}
OsExiter(1) OsExiter(1)
} }
}

View File

@ -100,7 +100,7 @@ func TestHandleExitCoder_ErrorWithoutMessage(t *testing.T) {
err := errors.New("") err := errors.New("")
HandleExitCoder(err) HandleExitCoder(err)
expect(t, exitCode, 0) expect(t, exitCode, 1)
expect(t, called, false) expect(t, called, true)
expect(t, ErrWriter.(*bytes.Buffer).String(), "") expect(t, ErrWriter.(*bytes.Buffer).String(), "")
} }