22 KiB
22 KiB
Change Log
ATTN: This project uses semantic versioning.
Unreleased
1.22.1 - 2019-09-11
Fixed
- Hide output of hidden commands on man pages in urfave/cli/pull/889 via @crosbymichael
- Don't generate fish completion for hidden commands urfave/cli/pull/891 via @saschagrunert
- Using short flag names for required flags throws an error in urfave/cli/pull/890 via @asahasrabuddhe
Changed
- Remove flag code generation logic, legacy python test runner in urfave/cli/pull/883 via @asahasrabuddhe
- Enable Go Modules support, drop support for
Go 1.10add support forGo 1.13in urfave/cli/pull/885 via @asahasrabuddhe
1.22.0 - 2019-09-07
Fixed
- Fix Subcommands not falling back to
app.ExitEventHandlerin urfave/cli/pull/856 via @FaranIdo
Changed
- Clarify that altsrc supports both TOML and JSON in urfave/cli/pull/774 via @whereswaldon
- Made the exit code example more clear in urfave/cli/pull/823 via @xordspar0
- Removed the use of python for internal flag generation in urfave/cli/pull/836 via @asahasrabuddhe
- Changed the supported go versions to
1.10,1.11,1.12in urfave/cli/pull/843 via @lafriks - Changed the v1 releases section in the readme in urfave/cli/pull/862 via @russoj88
- Cleaned up go modules in urfave/cli/pull/874 via @saschagrunert
Added
- Added
UseShortOptionHandlingfor combining short flags in urfave/cli/pull/735 via @rliebz - Added support for flags bash completion in urfave/cli/pull/808 via @yogeshlonkar
- Added the
TakesFileindicator to flag in urfave/cli/pull/851 via @saschagrunert - Added fish shell completion support in urfave/cli/pull/848 via @saschagrunert
1.21.0 - 2019-08-02
Fixed
- Fix using "slice" flag types with
EnvVarin urfave/cli/pull/687 via @joshuarubin - Fix regression of
SkipFlagParsingbehavior in urfave/cli/pull/697 via @jszwedko - Fix handling
ShortOptionsandSkipArgReorderin urfave/cli/pull/686 via @baude - Fix args reordering when bool flags are present in urfave/cli/pull/712 via @windler
- Fix parsing of short options in urfave/cli/pull/758 via @vrothberg
- Fix unaligned indents for the command help messages in urfave/cli/pull/806 via @mingrammer
Changed
- Cleaned up help output in urfave/cli/pull/664 via @maguro
- Remove redundant nil checks in urfave/cli/pull/773 via @teresy
- Case is now considered when sorting strings in urfave/cli/pull/676 via @rliebz
Added
- Added "required flags" support in urfave/cli/pull/819 via @lynncyrin
- Backport JSON
InputSourceto v1 in urfave/cli/pull/598 via @jszwedko - Allow more customization of flag help strings in urfave/cli/pull/661 via @rliebz
- Allow custom
ExitErrorhandler function in urfave/cli/pull/628 via @phinnaeus - Allow loading a variable from a file in urfave/cli/pull/675 via @jmccann
- Allow combining short bool names in urfave/cli/pull/684 via @baude
- Added test coverage to context in urfave/cli/pull/788 via @benzvan
- Added go module support in urfave/cli/pull/831 via @saschagrunert
1.20.0 - 2017-08-10
Fixed
HandleExitCoderis now correctly iterates over all errors in aMultiError. The exit code is the exit code of the last error or1if there are noExitCoders in theMultiError.- Fixed YAML file loading on Windows (previously would fail validate the file path)
- Subcommand
Usage,Description,ArgsUsage,OnUsageErrorcorrectly propogated ErrWriteris now passed downwards through command structure to avoid the need to redefine it- Pass
Commandcontext intoOnUsageErrorrather than parent context so that all fields are avaiable - Errors occuring in
Beforefuncs are no longer double printed - Use
UsageTextin the help templates for commands and subcommands if defined; otherwise build the usage as before (was previously ignoring this field) IsSetandGlobalIsSetnow correctly return whether a flag is set if a program callsSetorGlobalSetdirectly after flag parsing (would previously only returntrueif the flag was set during parsing)
Changed
- No longer exit the program on command/subcommand error if the error raised is
not an
OsExiter. This exiting behavior was introduced in 1.19.0, but was determined to be a regression in functionality. See the PR for discussion.
Added
CommandsByNametype was added to make it easy to sortCommands by name, alphabeticallyaltsrcnow handles loading of string and int arrays from TOML- Support for definition of custom help templates for
AppviaCustomAppHelpTemplate - Support for arbitrary key/value fields on
Appto be used withCustomAppHelpTemplateviaExtraInfo HelpFlag,VersionFlag, andBashCompletionFlagchanged to explictly becli.Flags allowing for the use of custom flags satisfying thecli.Flaginterface to be used.
1.19.1 - 2016-11-21
Fixed
- Fixes regression introduced in 1.19.0 where using an
ActionFuncas theActionfor a command would cause it to error rather than calling the function. Should not have a affected declarative cases usingfunc(c *cli.Context) err). - Shell completion now handles the case where the user specifies
--generate-bash-completionimmediately after a flag that takes an argument. Previously it call the application with--generate-bash-completionas the flag value.
1.19.0 - 2016-11-19
Added
FlagsByNamewas added to make it easy to sort flags (e.g.sort.Sort(cli.FlagsByName(app.Flags)))- A
Descriptionfield was added toAppfor a more detailed description of the application (similar to the existingDescriptionfield onCommand) - Flag type code generation via
go generate - Write to stderr and exit 1 if action returns non-nil error
- Added support for TOML to the
altsrcloader SkipArgReorderwas added to allow users to skip the argument reordering. This is useful if you want to consider all "flags" after an argument as arguments rather than flags (the default behavior of the stdlibflaglibrary). This is backported functionality from the removal of the flag reordering in the unreleased version 2- For formatted errors (those implementing
ErrorFormatter), the errors will be formatted during output. Compatible withpkg/errors.
Changed
- Raise minimum tested/supported Go version to 1.2+
Fixed
- Consider empty environment variables as set (previously environment variables
with the equivalent of
""would be skipped rather than their value used). - Return an error if the value in a given environment variable cannot be parsed as the flag type. Previously these errors were silently swallowed.
- Print full error when an invalid flag is specified (which includes the invalid flag)
App.Writerdefaults tostdoutwhennil- If no action is specified on a command or app, the help is now printed instead of
panicing App.Metadatais initialized automatically now (previously wasnilunless initialized)- Correctly show help message if
-his provided to a subcommand context.(Global)IsSetnow respects environment variables. Previously it would returnfalseif a flag was specified in the environment rather than as an argument- Removed deprecation warnings to STDERR to avoid them leaking to the end-user
altsrcs import paths were updated to usegopkg.in/urfave/cli.v1. This fixes issues that occurred whengopkg.in/urfave/cli.v1was imported as well asaltsrcwhere Go would complain that the types didn't match
[1.18.1] - 2016-08-28
Fixed
- Removed deprecation warnings to STDERR to avoid them leaking to the end-user (backported)
1.18.0 - 2016-06-27
Added
./runteststest runner with coverage tracking by default- testing on OS X
- testing on Windows
UintFlag,Uint64Flag, andInt64Flagtypes and supporting code
Changed
- Use spaces for alignment in help/usage output instead of tabs, making the output alignment consistent regardless of tab width
Fixed
- Printing of command aliases in help text
- Printing of visible flags for both struct and struct pointer flags
- Display the
helpsubcommand when usingCommandCategories - No longer swallows
panics that occur within theActions themselves when detecting the signature of theActionfield
[1.17.1] - 2016-08-28
Fixed
- Removed deprecation warnings to STDERR to avoid them leaking to the end-user
1.17.0 - 2016-05-09
Added
- Pluggable flag-level help text rendering via
cli.DefaultFlagStringFunc context.GlobalBoolTwas added as an analogue tocontext.GlobalBool- Support for hiding commands by setting
Hidden: true-- this will hide the commands in help output
Changed
Float64Flag,IntFlag, andDurationFlagdefault values are no longer quoted in help text output.- All flag types now include
(default: {value})strings following usage when a default value can be (reasonably) detected. IntSliceFlagandStringSliceFlagusage strings are now more consistent with non-slice flag types- Apps now exit with a code of 3 if an unknown subcommand is specified
(previously they printed "No help topic for...", but still exited 0. This
makes it easier to script around apps built using
clisince they can trust that a 0 exit code indicated a successful execution. - cleanups based on Go Report Card feedback
[1.16.1] - 2016-08-28
Fixed
- Removed deprecation warnings to STDERR to avoid them leaking to the end-user
1.16.0 - 2016-05-02
Added
Hiddenfield on all flag struct types to omit from generated help text
Changed
BashCompletionFlag(--enable-bash-completion) is now omitted from generated help text via theHiddenfield
Fixed
- handling of error values in
HandleActionandHandleExitCoder
1.15.0 - 2016-04-30
Added
- This file!
- Support for placeholders in flag usage strings
App.Metadatamap for arbitrary data/state managementSetandGlobalSetmethods on*cli.Contextfor altering values after parsing.- Support for nested lookup of dot-delimited keys in structures loaded from YAML.
Changed
- The
App.ActionandCommand.Actionnow prefer a return signature offunc(*cli.Context) error, as defined bycli.ActionFunc. If a non-nilerroris returned, there may be two outcomes:- If the error fulfills
cli.ExitCoder, thenos.Exitwill be called automatically - Else the error is bubbled up and returned from
App.Run
- If the error fulfills
- Specifying an
Actionwith the legacy return signature offunc(*cli.Context)will produce a deprecation message to stderr - Specifying an
Actionthat is not afunctype will produce a non-zero exit fromApp.Run - Specifying an
Actionfunc that has an invalid (input) signature will produce a non-zero exit fromApp.Run
Deprecated
-
cli.App.RunAndExitOnError, which should now be done by returning an error that fulfillscli.ExitCodertocli.App.Run. - the legacy signature for
cli.App.Actionoffunc(*cli.Context), which should now have a return signature offunc(*cli.Context) error, as defined bycli.ActionFunc.
Fixed
- Added missing
*cli.Context.GlobalFloat64method
1.14.0 - 2016-04-03 (backfilled 2016-04-25)
Added
- Codebeat badge
- Support for categorization via
CategorizedHelpandCategorieson app.
Changed
- Use
filepath.Baseinstead ofpath.BaseinNameandHelpName.
Fixed
- Ensure version is not shown in help text when
HideVersionset.
1.13.0 - 2016-03-06 (backfilled 2016-04-25)
Added
- YAML file input support.
NArgmethod on context.
1.12.0 - 2016-02-17 (backfilled 2016-04-25)
Added
- Custom usage error handling.
- Custom text support in
USAGEsection of help output. - Improved help messages for empty strings.
- AppVeyor CI configuration.
Changed
- Removed
panicfrom default help printer func. - De-duping and optimizations.
Fixed
- Correctly handle
Before/Afterat command level when no subcommands. - Case of literal
-argument causing flag reordering. - Environment variable hints on Windows.
- Docs updates.
1.11.1 - 2015-12-21 (backfilled 2016-04-25)
Changed
- Use
path.BaseinNameandHelpName - Export
GetNameon flag types.
Fixed
- Flag parsing when skipping is enabled.
- Test output cleanup.
- Move completion check to account for empty input case.
1.11.0 - 2015-11-15 (backfilled 2016-04-25)
Added
- Destination scan support for flags.
- Testing against
tipin Travis CI config.
Changed
- Go version in Travis CI config.
Fixed
- Removed redundant tests.
- Use correct example naming in tests.
1.10.2 - 2015-10-29 (backfilled 2016-04-25)
Fixed
- Remove unused var in bash completion.
1.10.1 - 2015-10-21 (backfilled 2016-04-25)
Added
- Coverage and reference logos in README.
Fixed
- Use specified values in help and version parsing.
- Only display app version and help message once.
1.10.0 - 2015-10-06 (backfilled 2016-04-25)
Added
- More tests for existing functionality.
ArgsUsageat app and command level for help text flexibility.
Fixed
- Honor
HideHelpandHideVersioninApp.Run. - Remove juvenile word from README.
1.9.0 - 2015-09-08 (backfilled 2016-04-25)
Added
FullNameon command with accompanying help output update.- Set default
$PROGin bash completion.
Changed
- Docs formatting.
Fixed
- Removed self-referential imports in tests.
1.8.0 - 2015-06-30 (backfilled 2016-04-25)
Added
- Support for
Copyrightat app level. Parentfunc at context level to walk up context lineage.
Fixed
- Global flag processing at top level.
1.7.1 - 2015-06-11 (backfilled 2016-04-25)
Added
- Aggregate errors from
Before/Afterfuncs. - Doc comments on flag structs.
- Include non-global flags when checking version and help.
- Travis CI config updates.
Fixed
- Ensure slice type flags have non-nil values.
- Collect global flags from the full command hierarchy.
- Docs prose.
1.7.0 - 2015-05-03 (backfilled 2016-04-25)
Changed
HelpPrintersignature includes output writer.
Fixed
- Specify go 1.1+ in docs.
- Set
Writerwhen running command as app.
1.6.0 - 2015-03-23 (backfilled 2016-04-25)
Added
- Multiple author support.
NumFlagsat context level.Aliasesat command level.
Deprecated
ShortNameat command level.
Fixed
- Subcommand help output.
- Backward compatible support for deprecated
AuthorandEmailfields. - Docs regarding
Names/Aliases.
1.5.0 - 2015-02-20 (backfilled 2016-04-25)
Added
Afterhook func support at app and command level.
Fixed
- Use parsed context when running command as subcommand.
- Docs prose.
1.4.1 - 2015-01-09 (backfilled 2016-04-25)
Added
- Support for hiding
-h / --helpflags, but nothelpsubcommand. - Stop flag parsing after
--.
Fixed
- Help text for generic flags to specify single value.
- Use double quotes in output for defaults.
- Use
ParseIntinstead ofParseUintfor int environment var values. - Use
0as base when parsing int environment var values.
1.4.0 - 2014-12-12 (backfilled 2016-04-25)
Added
- Support for environment variable lookup "cascade".
- Support for
Stdouton app for output redirection.
Fixed
- Print command help instead of app help in
ShowCommandHelp.
1.3.1 - 2014-11-13 (backfilled 2016-04-25)
Added
- Docs and example code updates.
Changed
- Default
-v / --versionflag made optional.
1.3.0 - 2014-08-10 (backfilled 2016-04-25)
Added
FlagNamesat context level.- Exposed
VersionPrintervar for more control over version output. - Zsh completion hook.
AUTHORsection in default app help template.- Contribution guidelines.
DurationFlagtype.
1.2.0 - 2014-08-02
Added
- Support for environment variable defaults on flags plus tests.
1.1.0 - 2014-07-15
Added
- Bash completion.
- Optional hiding of built-in help command.
- Optional skipping of flag parsing at command level.
Author,Email, andCompiledmetadata on app.Beforehook func support at app and command level.CommandNotFoundfunc support at app level.- Command reference available on context.
GenericFlagtype.Float64Flagtype.BoolTFlagtype.IsSetflag helper on context.- More flag lookup funcs at context level.
- More tests & docs.
Changed
- Help template updates to account for presence/absence of flags.
- Separated subcommand help template.
- Exposed
HelpPrintervar for more control over help output.
1.0.0 - 2013-11-01
Added
helpflag in default app flag set and each command flag set.- Custom handling of argument parsing errors.
- Command lookup by name at app level.
StringSliceFlagtype and supportingStringSlicetype.IntSliceFlagtype and supportingIntSlicetype.- Slice type flag lookups by name at context level.
- Export of app and command help functions.
- More tests & docs.
0.1.0 - 2013-07-22
Added
- Initial implementation.