Releases: lahmatiy/clap
Releases · lahmatiy/clap
3.1.1
3.1.0
- Fixed signature of
command()
function by removing parameters except the first one, since others are not used anymore - Added throwing an error when using the second parameter in a command definition (i.e.
command("name", "[arg1] [arg2]")
) to avoid mistakes on migration from v2.0 - Allowed
-
as a value for arg
3.0.0
- Allowed args after and between options
- Replaced
chalk
withansi-colors
- Changed supported versions of Node.js to
^12.20.0
,^14.13.0
and>=15.0.0
- Converted to ESM. CommonJS is supported as well (dual module)
- See other change of 3.0 in 3.0.0-beta.1 release notes
3.0.0-beta.1
- Restored wrongly removed
Command#extend()
- Changed
Command
's constructor andCommand#command(method)
to takeusage
only (i.e.command('name [param]')
insteadcommand('name', '[param]')
) - Added
Command#clone()
method - Added
Command#getCommand(name)
andCommand#getCommands()
methods - Added
Command#getOption(name)
andCommand#getOptions()
methods - Added
Command#messageRef()
andOption#messageRef()
methods - Added
Command#createOptionValues(values)
method - Added
Command#help()
method similar toCommand#version()
, useCommand#help(false)
to disable default help action option - Fixed
Command#showHelp()
, it's now logs help message in console instead of returning it - Renamed
Command#showHelp()
intoCommand#outputHelp()
- Changed
Command
to store params info (asCommand#params
) even if no params - Removed
Command#infoOption()
method, useaction
in option's config instead, i.e.option(usage, description, { action: ... })
- Removed
Command#infoOptionAction
andinfoOptionAction
option forCommand
constructor as well - Removed
Command#shortcut()
method, useshortcut
in option's config instead, i.e.option(usage, description, { shortcut: ... })
- Changed
Command#command()
to raise an exception when subcommand name already in use - Removed
Command#setOptions()
method - Removed
Command#setOption()
method - Removed
Command#hasOptions()
method - Removed
Command#hasOption()
method - Removed
Command#hasCommands()
method - Removed
Command#normalize()
method (usecreateOptionValues()
instead) - Changed
Option
to store params info asOption#params
, it always an object even if no params - Added
Option#names()
method - Removed name validation for subcommands
- Allowed a number for options's short name
- Changed
argv
parse handlers to [init()
→applyConfig()
→prepareContext()
]+ →action()
- Changed exports
- Added
getCommandHelp()
function - Added
Params
class - Removed
Argument
class - Removed
color
option
- Added
2.0.1
2.0.0
- Dropped support for Node < 8
- Bumped deps to latest versions
- Added config argument for Command and create function
defaultHelp
option to prevent adding--
help option on command createinfoOptionAction
option to override action when info option involved (output to stdout andexit(0)
by default)
- Added
Command#infoOption()
method - Fixed failure on argv parsing when all types of values are passed (i.e. args & options & literal args)
- Renamed
create()
method tocommand()
- Removed
error()
method - Removed
confirm()
method