Merge branch 'master' into toml-support
This commit is contained in:
commit
af0ac0f1f3
@ -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+
|
||||||
|
10
README.md
10
README.md
@ -953,7 +953,7 @@ setting `cli.VersionFlag`, e.g.:
|
|||||||
|
|
||||||
<!-- {
|
<!-- {
|
||||||
"args": ["--print-version"],
|
"args": ["--print-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": ["--version"],
|
"args": ["--version"],
|
||||||
"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{
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -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(), "")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user