⚠️ This document is no longer being actively maintained. Please see the releases page for all release notes and related hypermedia for releases>= 1.22.5
,>= 2.3.0
.
ATTN: This project uses semantic versioning.
View unreleased 2.X series changes.
2.2.0 - 2020-03-08
These release notes were written for the git hash d648edd48d89ef3a841b1ec75c2ebbd4de5f748f
- Fixed zsh completion scripts in urfave/cli/pull/1062 via @zhsj
- Fixed description of subcommand to be more consistent in urfave/cli/pull/1054 via @itchyny
- Fixed possible runtime panic in slice parsing in urfave/cli/pull/1049 via @saschagrunert
- Fixed invalid man page header generation in urfave/cli/pull/1041 via @saschagrunert
- Improved auto-completion instructions and added example gifs in urfave/cli/pull/1059 via @masonj188
- Removed the author from generated man pages in urfave/cli/pull/1041 via @saschagrunert
- Added destination field to
StringSliceFlag
in urfave/cli/pull/1078 via @davidsbond - Added
HideHelpCommand
. WhileHideHelp
hides bothhelp
command and--help
flag,HideHelpCommand
only hideshelp
command and leave--help
flag as-is in urfave/cli/pull/1083 via @AkihiroSuda - Added timestampFlag docs in urfave/cli/pull/997 via @drov0
- Added required flags documentation in urfave/cli/pull/1008 via @lynncyrin, @anberns
2.1.1 - 2019-12-24
- Fixed a
Context
regression introduced inv2.1.0
in urfave/cli/pull/1014 via @lynncyrin
2.1.0 - 2019-12-24
These release notes were written for the git hash ae84df4cef4a2a6f1a0cb1d41ea0f3af8755e5a8
- Fixed some golint errors in urfave/cli/pull/988 via @liamchampton
- Fixed a panic with flag completion urfave/cli/pull/946 via @unRob
- Changed docs generation to use visible flags in urfave/cli/pull/999 via @subpop
- Changed
App.Run
to use an optional context for timeouts and cancellation in urfave/cli/pull/975 via @marwan-at-work - Changed version info to be hidden if the user has not defined a version in urfave/cli/pull/955 via @asahasrabuddhe
- Changed docs generation to take into account multiple authors in urfave/cli/pull/900 via @saschagrunert
- Changed context to expose a
Value
accessor in urfave/cli/pull/741 via @corruptmemory
- Added timestamp flag in urfave/cli/pull/987 via @drov0
2.0.0 - 2019-11-17
The V2 changes were all shipped in urfave/cli/pull/892, which was created with the effort of over a dozen participants! They are:
@asahasrabuddhe, @meatballhat, @jszwedko, @lynncyrin, @AudriusButkevicius, @saschagrunert, @rliebz, @johnweldon, @nlewo, @grubernaut, @OneOfOne, @VMitov, @cbranch, @marwan-at-work, @uudashr, @bfreis
- Added
NewStringSlice
andNewIntSlice
for creating their related types - Added
Float64SliceFlag
for unmarshaling a list of floats from the user - Added
Context.Lineage
to get all contexts from current up to global - Added
Context.LocalFlagNames
to get the flag names from only the current context - Added
BoolFlag.Value
to handle both default-false and default-true - Added
IsSet
method to theFlag
interface which allows us to detect whether or not a flag has been set
Context.FlagNames
now returns all flags in the context lineageContext.IsSet
now considers the full context lineage
- Removed the ability to specify
&StringSlice{...string}
or&IntSlice{...int}
. - Removed adapter code for deprecated
Action
func signature - Deprecated
App.Author
,App.Email
, andCommand.ShortName
fields - Removed all
Context.Global*
methods, as the non-global versions now traverse up the context lineage automatically. - Removed
Context.Parent
method, as this is now available viaContext.Lineage
- Removed
BoolTFlag
and related code, as this is now available viaBoolFlag.Value
View unreleased 1.22.X series changes.
1.22.4 - 2020-03-31
- Fixed a panic with flag completion in urfave/cli/pull/1101 via @unRob, @VirrageS
1.22.3 - 2020-02-25
- String flag no longer persists the default value if the flag is explicitly initialized in urfave/cli/pull/981 via @asahasrabuddhe
context.IsSet()
returnstrue
orfalse
correctly regardless of whether the short name or the full name of the flag is passed to it in urfave/cli/pull/978 via @asahasrabuddhe- Hide version if the version is not set by the user in urfave/cli/pull/954 via @asahasrabuddhe
1.22.2 - 2019-11-17
- Fix v1.21.0 pass through regression in urfave/cli/pull/872 via @lynncyrin
- Fix infinite loop when parsing invalid flags for apps with short option handling in urfave/cli/pull/911 via @rliebz
- Fix zsh autocomplete in urfave/cli/pull/906 via @gnowxilef
- Fix typo in
DocGenerationFlag.TakesValue()
docstring in urfave/cli/pull/902 via @benmoose - Avoid panic for missing flag value in urfave/cli/pull/893 via @rliebz
- Simplify
HelpPrinter
andCustomHelpPrinter
behaviors in urfave/cli/pull/912 via @rliebz
1.22.1 - 2019-09-11
- 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
- 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.10
add support forGo 1.13
in urfave/cli/pull/885 via @asahasrabuddhe
1.22.0 - 2019-09-07
- Fix Subcommands not falling back to
app.ExitEventHandler
in urfave/cli/pull/856 via @FaranIdo
- 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.12
in 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
UseShortOptionHandling
for 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
TakesFile
indicator 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
- Fix using "slice" flag types with
EnvVar
in urfave/cli/pull/687 via @joshuarubin - Fix regression of
SkipFlagParsing
behavior in urfave/cli/pull/697 via @jszwedko - Fix handling
ShortOptions
andSkipArgReorder
in 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
- 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 "required flags" support in urfave/cli/pull/819 via @lynncyrin
- Backport JSON
InputSource
to v1 in urfave/cli/pull/598 via @jszwedko - Allow more customization of flag help strings in urfave/cli/pull/661 via @rliebz
- Allow custom
ExitError
handler 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
HandleExitCoder
is now correctly iterates over all errors in aMultiError
. The exit code is the exit code of the last error or1
if there are noExitCoder
s in theMultiError
.- Fixed YAML file loading on Windows (previously would fail validate the file path)
- Subcommand
Usage
,Description
,ArgsUsage
,OnUsageError
correctly propagated ErrWriter
is now passed downwards through command structure to avoid the need to redefine it- Pass
Command
context intoOnUsageError
rather than parent context so that all fields are available - Errors occurring in
Before
funcs are no longer double printed - Use
UsageText
in the help templates for commands and subcommands if defined; otherwise build the usage as before (was previously ignoring this field) IsSet
andGlobalIsSet
now correctly return whether a flag is set if a program callsSet
orGlobalSet
directly after flag parsing (would previously only returntrue
if the flag was set during parsing)
- 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.
CommandsByName
type was added to make it easy to sortCommand
s by name, alphabeticallyaltsrc
now handles loading of string and int arrays from TOML- Support for definition of custom help templates for
App
viaCustomAppHelpTemplate
- Support for arbitrary key/value fields on
App
to be used withCustomAppHelpTemplate
viaExtraInfo
HelpFlag
,VersionFlag
, andBashCompletionFlag
changed to explicitly becli.Flag
s allowing for the use of custom flags satisfying thecli.Flag
interface to be used.
1.19.1 - 2016-11-21
- Fixes regression introduced in 1.19.0 where using an
ActionFunc
as theAction
for 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-completion
immediately after a flag that takes an argument. Previously it call the application with--generate-bash-completion
as the flag value.
1.19.0 - 2016-11-19
FlagsByName
was added to make it easy to sort flags (e.g.sort.Sort(cli.FlagsByName(app.Flags))
)- A
Description
field was added toApp
for a more detailed description of the application (similar to the existingDescription
field 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
altsrc
loader SkipArgReorder
was 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 stdlibflag
library). 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
.
- Raise minimum tested/supported Go version to 1.2+
- 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.Writer
defaults tostdout
whennil
- If no action is specified on a command or app, the help is now printed instead of
panic
ing App.Metadata
is initialized automatically now (previously wasnil
unless initialized)- Correctly show help message if
-h
is provided to a subcommand context.(Global)IsSet
now respects environment variables. Previously it would returnfalse
if 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
altsrc
s import paths were updated to usegopkg.in/urfave/cli.v1
. This fixes issues that occurred whengopkg.in/urfave/cli.v1
was imported as well asaltsrc
where Go would complain that the types didn't match
- Removed deprecation warnings to STDERR to avoid them leaking to the end-user (backported)
1.18.0 - 2016-06-27
./runtests
test runner with coverage tracking by default- testing on OS X
- testing on Windows
UintFlag
,Uint64Flag
, andInt64Flag
types and supporting code
- Use spaces for alignment in help/usage output instead of tabs, making the output alignment consistent regardless of tab width
- Printing of command aliases in help text
- Printing of visible flags for both struct and struct pointer flags
- Display the
help
subcommand when usingCommandCategories
- No longer swallows
panic
s that occur within theAction
s themselves when detecting the signature of theAction
field
- Removed deprecation warnings to STDERR to avoid them leaking to the end-user
1.17.0 - 2016-05-09
- Pluggable flag-level help text rendering via
cli.DefaultFlagStringFunc
context.GlobalBoolT
was added as an analogue tocontext.GlobalBool
- Support for hiding commands by setting
Hidden: true
-- this will hide the commands in help output
Float64Flag
,IntFlag
, andDurationFlag
default 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. IntSliceFlag
andStringSliceFlag
usage 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
cli
since they can trust that a 0 exit code indicated a successful execution. - cleanups based on Go Report Card feedback
- Removed deprecation warnings to STDERR to avoid them leaking to the end-user
1.16.0 - 2016-05-02
Hidden
field on all flag struct types to omit from generated help text
BashCompletionFlag
(--enable-bash-completion
) is now omitted from generated help text via theHidden
field
- handling of error values in
HandleAction
andHandleExitCoder
1.15.0 - 2016-04-30
- This file!
- Support for placeholders in flag usage strings
App.Metadata
map for arbitrary data/state managementSet
andGlobalSet
methods on*cli.Context
for altering values after parsing.- Support for nested lookup of dot-delimited keys in structures loaded from YAML.
- The
App.Action
andCommand.Action
now prefer a return signature offunc(*cli.Context) error
, as defined bycli.ActionFunc
. If a non-nilerror
is returned, there may be two outcomes:- If the error fulfills
cli.ExitCoder
, thenos.Exit
will be called automatically - Else the error is bubbled up and returned from
App.Run
- If the error fulfills
- Specifying an
Action
with the legacy return signature offunc(*cli.Context)
will produce a deprecation message to stderr - Specifying an
Action
that is not afunc
type will produce a non-zero exit fromApp.Run
- Specifying an
Action
func that has an invalid (input) signature will produce a non-zero exit fromApp.Run
-
cli.App.RunAndExitOnError
, which should now be done by returning an error that fulfillscli.ExitCoder
tocli.App.Run
. - the legacy signature for
cli.App.Action
offunc(*cli.Context)
, which should now have a return signature offunc(*cli.Context) error
, as defined bycli.ActionFunc
.
- Added missing
*cli.Context.GlobalFloat64
method
1.14.0 - 2016-04-03 (backfilled 2016-04-25)
- Codebeat badge
- Support for categorization via
CategorizedHelp
andCategories
on app.
- Use
filepath.Base
instead ofpath.Base
inName
andHelpName
.
- Ensure version is not shown in help text when
HideVersion
set.
1.13.0 - 2016-03-06 (backfilled 2016-04-25)
- YAML file input support.
NArg
method on context.
1.12.0 - 2016-02-17 (backfilled 2016-04-25)
- Custom usage error handling.
- Custom text support in
USAGE
section of help output. - Improved help messages for empty strings.
- AppVeyor CI configuration.
- Removed
panic
from default help printer func. - De-duping and optimizations.
- Correctly handle
Before
/After
at 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)
- Use
path.Base
inName
andHelpName
- Export
GetName
on flag types.
- 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)
- Destination scan support for flags.
- Testing against
tip
in Travis CI config.
- Go version in Travis CI config.
- Removed redundant tests.
- Use correct example naming in tests.
1.10.2 - 2015-10-29 (backfilled 2016-04-25)
- Remove unused var in bash completion.
1.10.1 - 2015-10-21 (backfilled 2016-04-25)
- Coverage and reference logos in README.
- 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)
- More tests for existing functionality.
ArgsUsage
at app and command level for help text flexibility.
- Honor
HideHelp
andHideVersion
inApp.Run
. - Remove juvenile word from README.
1.9.0 - 2015-09-08 (backfilled 2016-04-25)
FullName
on command with accompanying help output update.- Set default
$PROG
in bash completion.
- Docs formatting.
- Removed self-referential imports in tests.
1.8.0 - 2015-06-30 (backfilled 2016-04-25)
- Support for
Copyright
at app level. Parent
func at context level to walk up context lineage.
- Global flag processing at top level.
1.7.1 - 2015-06-11 (backfilled 2016-04-25)
- Aggregate errors from
Before
/After
funcs. - Doc comments on flag structs.
- Include non-global flags when checking version and help.
- Travis CI config updates.
- 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)
HelpPrinter
signature includes output writer.
- Specify go 1.1+ in docs.
- Set
Writer
when running command as app.
1.6.0 - 2015-03-23 (backfilled 2016-04-25)
- Multiple author support.
NumFlags
at context level.Aliases
at command level.
ShortName
at command level.
- Subcommand help output.
- Backward compatible support for deprecated
Author
andEmail
fields. - Docs regarding
Names
/Aliases
.
1.5.0 - 2015-02-20 (backfilled 2016-04-25)
After
hook func support at app and command level.
- Use parsed context when running command as subcommand.
- Docs prose.
1.4.1 - 2015-01-09 (backfilled 2016-04-25)
- Support for hiding
-h / --help
flags, but nothelp
subcommand. - Stop flag parsing after
--
.
- Help text for generic flags to specify single value.
- Use double quotes in output for defaults.
- Use
ParseInt
instead ofParseUint
for int environment var values. - Use
0
as base when parsing int environment var values.
1.4.0 - 2014-12-12 (backfilled 2016-04-25)
- Support for environment variable lookup "cascade".
- Support for
Stdout
on app for output redirection.
- Print command help instead of app help in
ShowCommandHelp
.
1.3.1 - 2014-11-13 (backfilled 2016-04-25)
- Docs and example code updates.
- Default
-v / --version
flag made optional.
1.3.0 - 2014-08-10 (backfilled 2016-04-25)
FlagNames
at context level.- Exposed
VersionPrinter
var for more control over version output. - Zsh completion hook.
AUTHOR
section in default app help template.- Contribution guidelines.
DurationFlag
type.
1.2.0 - 2014-08-02
- Support for environment variable defaults on flags plus tests.
1.1.0 - 2014-07-15
- Bash completion.
- Optional hiding of built-in help command.
- Optional skipping of flag parsing at command level.
Author
,Email
, andCompiled
metadata on app.Before
hook func support at app and command level.CommandNotFound
func support at app level.- Command reference available on context.
GenericFlag
type.Float64Flag
type.BoolTFlag
type.IsSet
flag helper on context.- More flag lookup funcs at context level.
- More tests & docs.
- Help template updates to account for presence/absence of flags.
- Separated subcommand help template.
- Exposed
HelpPrinter
var for more control over help output.
1.0.0 - 2013-11-01
help
flag in default app flag set and each command flag set.- Custom handling of argument parsing errors.
- Command lookup by name at app level.
StringSliceFlag
type and supportingStringSlice
type.IntSliceFlag
type and supportingIntSlice
type.- Slice type flag lookups by name at context level.
- Export of app and command help functions.
- More tests & docs.
- Initial implementation.