1# Change Log 2 3**ATTN**: This project uses [semantic versioning](http://semver.org/). 4 5## [Unreleased] 6 7## 1.20.0 - 2017-08-10 8 9### Fixed 10 11* `HandleExitCoder` is now correctly iterates over all errors in 12 a `MultiError`. The exit code is the exit code of the last error or `1` if 13 there are no `ExitCoder`s in the `MultiError`. 14* Fixed YAML file loading on Windows (previously would fail validate the file path) 15* Subcommand `Usage`, `Description`, `ArgsUsage`, `OnUsageError` correctly 16 propogated 17* `ErrWriter` is now passed downwards through command structure to avoid the 18 need to redefine it 19* Pass `Command` context into `OnUsageError` rather than parent context so that 20 all fields are avaiable 21* Errors occuring in `Before` funcs are no longer double printed 22* Use `UsageText` in the help templates for commands and subcommands if 23 defined; otherwise build the usage as before (was previously ignoring this 24 field) 25* `IsSet` and `GlobalIsSet` now correctly return whether a flag is set if 26 a program calls `Set` or `GlobalSet` directly after flag parsing (would 27 previously only return `true` if the flag was set during parsing) 28 29### Changed 30 31* No longer exit the program on command/subcommand error if the error raised is 32 not an `OsExiter`. This exiting behavior was introduced in 1.19.0, but was 33 determined to be a regression in functionality. See [the 34 PR](https://github.com/urfave/cli/pull/595) for discussion. 35 36### Added 37 38* `CommandsByName` type was added to make it easy to sort `Command`s by name, 39 alphabetically 40* `altsrc` now handles loading of string and int arrays from TOML 41* Support for definition of custom help templates for `App` via 42 `CustomAppHelpTemplate` 43* Support for arbitrary key/value fields on `App` to be used with 44 `CustomAppHelpTemplate` via `ExtraInfo` 45* `HelpFlag`, `VersionFlag`, and `BashCompletionFlag` changed to explictly be 46 `cli.Flag`s allowing for the use of custom flags satisfying the `cli.Flag` 47 interface to be used. 48 49 50## [1.19.1] - 2016-11-21 51 52### Fixed 53 54- Fixes regression introduced in 1.19.0 where using an `ActionFunc` as 55 the `Action` for a command would cause it to error rather than calling the 56 function. Should not have a affected declarative cases using `func(c 57 *cli.Context) err)`. 58- Shell completion now handles the case where the user specifies 59 `--generate-bash-completion` immediately after a flag that takes an argument. 60 Previously it call the application with `--generate-bash-completion` as the 61 flag value. 62 63## [1.19.0] - 2016-11-19 64### Added 65- `FlagsByName` was added to make it easy to sort flags (e.g. `sort.Sort(cli.FlagsByName(app.Flags))`) 66- A `Description` field was added to `App` for a more detailed description of 67 the application (similar to the existing `Description` field on `Command`) 68- Flag type code generation via `go generate` 69- Write to stderr and exit 1 if action returns non-nil error 70- Added support for TOML to the `altsrc` loader 71- `SkipArgReorder` was added to allow users to skip the argument reordering. 72 This is useful if you want to consider all "flags" after an argument as 73 arguments rather than flags (the default behavior of the stdlib `flag` 74 library). This is backported functionality from the [removal of the flag 75 reordering](https://github.com/urfave/cli/pull/398) in the unreleased version 76 2 77- For formatted errors (those implementing `ErrorFormatter`), the errors will 78 be formatted during output. Compatible with `pkg/errors`. 79 80### Changed 81- Raise minimum tested/supported Go version to 1.2+ 82 83### Fixed 84- Consider empty environment variables as set (previously environment variables 85 with the equivalent of `""` would be skipped rather than their value used). 86- Return an error if the value in a given environment variable cannot be parsed 87 as the flag type. Previously these errors were silently swallowed. 88- Print full error when an invalid flag is specified (which includes the invalid flag) 89- `App.Writer` defaults to `stdout` when `nil` 90- If no action is specified on a command or app, the help is now printed instead of `panic`ing 91- `App.Metadata` is initialized automatically now (previously was `nil` unless initialized) 92- Correctly show help message if `-h` is provided to a subcommand 93- `context.(Global)IsSet` now respects environment variables. Previously it 94 would return `false` if a flag was specified in the environment rather than 95 as an argument 96- Removed deprecation warnings to STDERR to avoid them leaking to the end-user 97- `altsrc`s import paths were updated to use `gopkg.in/urfave/cli.v1`. This 98 fixes issues that occurred when `gopkg.in/urfave/cli.v1` was imported as well 99 as `altsrc` where Go would complain that the types didn't match 100 101## [1.18.1] - 2016-08-28 102### Fixed 103- Removed deprecation warnings to STDERR to avoid them leaking to the end-user (backported) 104 105## [1.18.0] - 2016-06-27 106### Added 107- `./runtests` test runner with coverage tracking by default 108- testing on OS X 109- testing on Windows 110- `UintFlag`, `Uint64Flag`, and `Int64Flag` types and supporting code 111 112### Changed 113- Use spaces for alignment in help/usage output instead of tabs, making the 114 output alignment consistent regardless of tab width 115 116### Fixed 117- Printing of command aliases in help text 118- Printing of visible flags for both struct and struct pointer flags 119- Display the `help` subcommand when using `CommandCategories` 120- No longer swallows `panic`s that occur within the `Action`s themselves when 121 detecting the signature of the `Action` field 122 123## [1.17.1] - 2016-08-28 124### Fixed 125- Removed deprecation warnings to STDERR to avoid them leaking to the end-user 126 127## [1.17.0] - 2016-05-09 128### Added 129- Pluggable flag-level help text rendering via `cli.DefaultFlagStringFunc` 130- `context.GlobalBoolT` was added as an analogue to `context.GlobalBool` 131- Support for hiding commands by setting `Hidden: true` -- this will hide the 132 commands in help output 133 134### Changed 135- `Float64Flag`, `IntFlag`, and `DurationFlag` default values are no longer 136 quoted in help text output. 137- All flag types now include `(default: {value})` strings following usage when a 138 default value can be (reasonably) detected. 139- `IntSliceFlag` and `StringSliceFlag` usage strings are now more consistent 140 with non-slice flag types 141- Apps now exit with a code of 3 if an unknown subcommand is specified 142 (previously they printed "No help topic for...", but still exited 0. This 143 makes it easier to script around apps built using `cli` since they can trust 144 that a 0 exit code indicated a successful execution. 145- cleanups based on [Go Report Card 146 feedback](https://goreportcard.com/report/github.com/urfave/cli) 147 148## [1.16.1] - 2016-08-28 149### Fixed 150- Removed deprecation warnings to STDERR to avoid them leaking to the end-user 151 152## [1.16.0] - 2016-05-02 153### Added 154- `Hidden` field on all flag struct types to omit from generated help text 155 156### Changed 157- `BashCompletionFlag` (`--enable-bash-completion`) is now omitted from 158generated help text via the `Hidden` field 159 160### Fixed 161- handling of error values in `HandleAction` and `HandleExitCoder` 162 163## [1.15.0] - 2016-04-30 164### Added 165- This file! 166- Support for placeholders in flag usage strings 167- `App.Metadata` map for arbitrary data/state management 168- `Set` and `GlobalSet` methods on `*cli.Context` for altering values after 169parsing. 170- Support for nested lookup of dot-delimited keys in structures loaded from 171YAML. 172 173### Changed 174- The `App.Action` and `Command.Action` now prefer a return signature of 175`func(*cli.Context) error`, as defined by `cli.ActionFunc`. If a non-nil 176`error` is returned, there may be two outcomes: 177 - If the error fulfills `cli.ExitCoder`, then `os.Exit` will be called 178 automatically 179 - Else the error is bubbled up and returned from `App.Run` 180- Specifying an `Action` with the legacy return signature of 181`func(*cli.Context)` will produce a deprecation message to stderr 182- Specifying an `Action` that is not a `func` type will produce a non-zero exit 183from `App.Run` 184- Specifying an `Action` func that has an invalid (input) signature will 185produce a non-zero exit from `App.Run` 186 187### Deprecated 188- <a name="deprecated-cli-app-runandexitonerror"></a> 189`cli.App.RunAndExitOnError`, which should now be done by returning an error 190that fulfills `cli.ExitCoder` to `cli.App.Run`. 191- <a name="deprecated-cli-app-action-signature"></a> the legacy signature for 192`cli.App.Action` of `func(*cli.Context)`, which should now have a return 193signature of `func(*cli.Context) error`, as defined by `cli.ActionFunc`. 194 195### Fixed 196- Added missing `*cli.Context.GlobalFloat64` method 197 198## [1.14.0] - 2016-04-03 (backfilled 2016-04-25) 199### Added 200- Codebeat badge 201- Support for categorization via `CategorizedHelp` and `Categories` on app. 202 203### Changed 204- Use `filepath.Base` instead of `path.Base` in `Name` and `HelpName`. 205 206### Fixed 207- Ensure version is not shown in help text when `HideVersion` set. 208 209## [1.13.0] - 2016-03-06 (backfilled 2016-04-25) 210### Added 211- YAML file input support. 212- `NArg` method on context. 213 214## [1.12.0] - 2016-02-17 (backfilled 2016-04-25) 215### Added 216- Custom usage error handling. 217- Custom text support in `USAGE` section of help output. 218- Improved help messages for empty strings. 219- AppVeyor CI configuration. 220 221### Changed 222- Removed `panic` from default help printer func. 223- De-duping and optimizations. 224 225### Fixed 226- Correctly handle `Before`/`After` at command level when no subcommands. 227- Case of literal `-` argument causing flag reordering. 228- Environment variable hints on Windows. 229- Docs updates. 230 231## [1.11.1] - 2015-12-21 (backfilled 2016-04-25) 232### Changed 233- Use `path.Base` in `Name` and `HelpName` 234- Export `GetName` on flag types. 235 236### Fixed 237- Flag parsing when skipping is enabled. 238- Test output cleanup. 239- Move completion check to account for empty input case. 240 241## [1.11.0] - 2015-11-15 (backfilled 2016-04-25) 242### Added 243- Destination scan support for flags. 244- Testing against `tip` in Travis CI config. 245 246### Changed 247- Go version in Travis CI config. 248 249### Fixed 250- Removed redundant tests. 251- Use correct example naming in tests. 252 253## [1.10.2] - 2015-10-29 (backfilled 2016-04-25) 254### Fixed 255- Remove unused var in bash completion. 256 257## [1.10.1] - 2015-10-21 (backfilled 2016-04-25) 258### Added 259- Coverage and reference logos in README. 260 261### Fixed 262- Use specified values in help and version parsing. 263- Only display app version and help message once. 264 265## [1.10.0] - 2015-10-06 (backfilled 2016-04-25) 266### Added 267- More tests for existing functionality. 268- `ArgsUsage` at app and command level for help text flexibility. 269 270### Fixed 271- Honor `HideHelp` and `HideVersion` in `App.Run`. 272- Remove juvenile word from README. 273 274## [1.9.0] - 2015-09-08 (backfilled 2016-04-25) 275### Added 276- `FullName` on command with accompanying help output update. 277- Set default `$PROG` in bash completion. 278 279### Changed 280- Docs formatting. 281 282### Fixed 283- Removed self-referential imports in tests. 284 285## [1.8.0] - 2015-06-30 (backfilled 2016-04-25) 286### Added 287- Support for `Copyright` at app level. 288- `Parent` func at context level to walk up context lineage. 289 290### Fixed 291- Global flag processing at top level. 292 293## [1.7.1] - 2015-06-11 (backfilled 2016-04-25) 294### Added 295- Aggregate errors from `Before`/`After` funcs. 296- Doc comments on flag structs. 297- Include non-global flags when checking version and help. 298- Travis CI config updates. 299 300### Fixed 301- Ensure slice type flags have non-nil values. 302- Collect global flags from the full command hierarchy. 303- Docs prose. 304 305## [1.7.0] - 2015-05-03 (backfilled 2016-04-25) 306### Changed 307- `HelpPrinter` signature includes output writer. 308 309### Fixed 310- Specify go 1.1+ in docs. 311- Set `Writer` when running command as app. 312 313## [1.6.0] - 2015-03-23 (backfilled 2016-04-25) 314### Added 315- Multiple author support. 316- `NumFlags` at context level. 317- `Aliases` at command level. 318 319### Deprecated 320- `ShortName` at command level. 321 322### Fixed 323- Subcommand help output. 324- Backward compatible support for deprecated `Author` and `Email` fields. 325- Docs regarding `Names`/`Aliases`. 326 327## [1.5.0] - 2015-02-20 (backfilled 2016-04-25) 328### Added 329- `After` hook func support at app and command level. 330 331### Fixed 332- Use parsed context when running command as subcommand. 333- Docs prose. 334 335## [1.4.1] - 2015-01-09 (backfilled 2016-04-25) 336### Added 337- Support for hiding `-h / --help` flags, but not `help` subcommand. 338- Stop flag parsing after `--`. 339 340### Fixed 341- Help text for generic flags to specify single value. 342- Use double quotes in output for defaults. 343- Use `ParseInt` instead of `ParseUint` for int environment var values. 344- Use `0` as base when parsing int environment var values. 345 346## [1.4.0] - 2014-12-12 (backfilled 2016-04-25) 347### Added 348- Support for environment variable lookup "cascade". 349- Support for `Stdout` on app for output redirection. 350 351### Fixed 352- Print command help instead of app help in `ShowCommandHelp`. 353 354## [1.3.1] - 2014-11-13 (backfilled 2016-04-25) 355### Added 356- Docs and example code updates. 357 358### Changed 359- Default `-v / --version` flag made optional. 360 361## [1.3.0] - 2014-08-10 (backfilled 2016-04-25) 362### Added 363- `FlagNames` at context level. 364- Exposed `VersionPrinter` var for more control over version output. 365- Zsh completion hook. 366- `AUTHOR` section in default app help template. 367- Contribution guidelines. 368- `DurationFlag` type. 369 370## [1.2.0] - 2014-08-02 371### Added 372- Support for environment variable defaults on flags plus tests. 373 374## [1.1.0] - 2014-07-15 375### Added 376- Bash completion. 377- Optional hiding of built-in help command. 378- Optional skipping of flag parsing at command level. 379- `Author`, `Email`, and `Compiled` metadata on app. 380- `Before` hook func support at app and command level. 381- `CommandNotFound` func support at app level. 382- Command reference available on context. 383- `GenericFlag` type. 384- `Float64Flag` type. 385- `BoolTFlag` type. 386- `IsSet` flag helper on context. 387- More flag lookup funcs at context level. 388- More tests & docs. 389 390### Changed 391- Help template updates to account for presence/absence of flags. 392- Separated subcommand help template. 393- Exposed `HelpPrinter` var for more control over help output. 394 395## [1.0.0] - 2013-11-01 396### Added 397- `help` flag in default app flag set and each command flag set. 398- Custom handling of argument parsing errors. 399- Command lookup by name at app level. 400- `StringSliceFlag` type and supporting `StringSlice` type. 401- `IntSliceFlag` type and supporting `IntSlice` type. 402- Slice type flag lookups by name at context level. 403- Export of app and command help functions. 404- More tests & docs. 405 406## 0.1.0 - 2013-07-22 407### Added 408- Initial implementation. 409 410[Unreleased]: https://github.com/urfave/cli/compare/v1.18.0...HEAD 411[1.18.0]: https://github.com/urfave/cli/compare/v1.17.0...v1.18.0 412[1.17.0]: https://github.com/urfave/cli/compare/v1.16.0...v1.17.0 413[1.16.0]: https://github.com/urfave/cli/compare/v1.15.0...v1.16.0 414[1.15.0]: https://github.com/urfave/cli/compare/v1.14.0...v1.15.0 415[1.14.0]: https://github.com/urfave/cli/compare/v1.13.0...v1.14.0 416[1.13.0]: https://github.com/urfave/cli/compare/v1.12.0...v1.13.0 417[1.12.0]: https://github.com/urfave/cli/compare/v1.11.1...v1.12.0 418[1.11.1]: https://github.com/urfave/cli/compare/v1.11.0...v1.11.1 419[1.11.0]: https://github.com/urfave/cli/compare/v1.10.2...v1.11.0 420[1.10.2]: https://github.com/urfave/cli/compare/v1.10.1...v1.10.2 421[1.10.1]: https://github.com/urfave/cli/compare/v1.10.0...v1.10.1 422[1.10.0]: https://github.com/urfave/cli/compare/v1.9.0...v1.10.0 423[1.9.0]: https://github.com/urfave/cli/compare/v1.8.0...v1.9.0 424[1.8.0]: https://github.com/urfave/cli/compare/v1.7.1...v1.8.0 425[1.7.1]: https://github.com/urfave/cli/compare/v1.7.0...v1.7.1 426[1.7.0]: https://github.com/urfave/cli/compare/v1.6.0...v1.7.0 427[1.6.0]: https://github.com/urfave/cli/compare/v1.5.0...v1.6.0 428[1.5.0]: https://github.com/urfave/cli/compare/v1.4.1...v1.5.0 429[1.4.1]: https://github.com/urfave/cli/compare/v1.4.0...v1.4.1 430[1.4.0]: https://github.com/urfave/cli/compare/v1.3.1...v1.4.0 431[1.3.1]: https://github.com/urfave/cli/compare/v1.3.0...v1.3.1 432[1.3.0]: https://github.com/urfave/cli/compare/v1.2.0...v1.3.0 433[1.2.0]: https://github.com/urfave/cli/compare/v1.1.0...v1.2.0 434[1.1.0]: https://github.com/urfave/cli/compare/v1.0.0...v1.1.0 435[1.0.0]: https://github.com/urfave/cli/compare/v0.1.0...v1.0.0 436