v0.23.1 (Apr 26, 2022)
Bug Fixes
- command: add missing default types for the FileType type (#361) (559bb4a)
- command: only first argument of rest arguments is completed with zsh completions (#359) (dc0c1de)
- command: first argument is also completed on index two (#358) (1784eef)
- command: zsh completion action not called for arguments (#357) (1a62fe8)
- command: fix option types for useRawArgs (#356) (7acac27)
Chore
- upgrade: deno/std@0.136.0, sinon@v13.0.2 (#362) (a6e4b45)
v0.23.0 (Apr 11, 2022)
BREAKING CHANGES
command: infer types and option names (#312) (efcad62)
With this release the
Command
class is now strict by default. All names and types from option, argument and environment variable definitions will be now automatically inferred 🚀Previously it was necessary to pass the
void
type as first generic argument to the command classCommand<void>
(which is now the default) to enable strict typings. The name and the type could than be specified by passing them to theoption
,arguments
orenv
methods:new Command<void>() .option<{ foo?: string }>("--foo <value:string>") .arguments<[string, string?]>("<input> [output]");
This is no longer necessary. Names and types are now automatically inferred from the definitions
"--foo <value:string>"
and you can define it just like the following example. Options and arguments will be automatically typed.new Command() .option("--foo <value:string>") .arguments("<input> [output]");
Dotted options, custom types like
EnumType
and options likedefault
,value
andprefix
are supported as well.To disable strict types you can pass the
any
type to the command classCommand<any>
which was previously the default._command: fix allowEmpty and disable it by default (#352) (c17718d)
Previously
.allowEmpty()
was enabled by default, which means if an required option was registered no error was thrown if the command was called without any arguments..allowEmpty()
is now disabled by default and has to be enabled manually.
Features
command: add new file type with path completion support (#353) (969f2dd)
If the
CompletionCommand
is registered, path completions will be enabled for arguments and options with thefile
type. The newfile
type can be used as following:new Command() .option("--input-file <path:file>", "The input file.")`
command: show long version format with long –version option (#343) (079b4ba)
command: show hint in help if a new version is available (#342) (bc9cfbf)
command,flags: add support for wildcard options (#351) (e604e44)
Wildcard options can be used to allow options with dynamic names. You can register them as following:
new Command() .option("--foo.*", "This options allows any name on the foo option.") .option( "--bar.*.*", "This options allows any nested name on the bar option.", );
Following options are valid options for the
--foo.*
option:--foo.bar
--foo.baz
Following options are valid options for the
--bar.*.*
option:--foo.bar.baz
--foo.beep.boop
flags: add
ignoreDefaults
option (#349) (22178af)prompt: add n & p keys for next & previous and left & right for next & prev page (#345) (d568f37)
prompt: add hideDefault option (#344) (dc460b6)
Bug Fixes
- suggestions value is always lower cased (#346) (5d1e3a7)
- command: default value from option overrides env var (#350) (2cd7735)
- prompt: prompt is not rendered properly if content is longer than the terminal (#347) (56755e1)
Code Refactoring
- flags: infer option types in option callback method (#348) (483bbf7)
- prompt: improve generic types for prompt methd (#335) (42e21f6)
Documentation Updates
Chore
- upgrade: deno/std@0.134.0 & sinon@v13.0.1 (#354) (f63b687)
v0.20.2 (Mar 16, 2022)
Features
- command: add support to show additional information in help text (#300) (e32f826)
- command: add support for enum’s in EnumType (#316) (d71071e)
- prompt: add support for path completion and dynamic suggestions (#306) (0be6da7)
Bug Fixes
- command: only first missing required variadic option throws an error (#331) (cf487de)
- command: integer argument with value 0 is ignored (#329) (11b824c)
- prompt: checkbox and select prompt fails with only one disabled option (#328) (683f260)
- table: chinese characters are not aligned correctly (#330) (e31b680)
Performance Improvements
- table: improve performance for tables without col and row span (#327) (29bcfd6)
Code Refactoring
- command: change return type of action handler to unknown (#315) (04e6917)
Chore
- add funding (ebafd0e)
- ci: use denoland/setup-deno in lint workflow (#332) (63b47d0)
- command: add script to update all test fixtures (#301) (89cc617)
- fmt: fmt readme (#305) (8c63fd8)
- fmt: fmt changelog (6d51275)
- upgrade: deno/std0.130.0 (#333) (336f0a1)
Documentation Updates
- prompt: add info for required –unstable flag (beca790)
v0.20.1 (Nov 1, 2021)
Code Refactoring
- command: preparation for the new typescript option –useUnknownInCatchVariables (#294) (864e915)
Chore
- upgrade: deno/std v0.113.0 (#295) (8d1664a)
v0.20.0 (Oct 23, 2021)
Features
- command: add value option for env vars (#290) (e5b2b2b)
Bug Fixes
- command: help text shows always long description for env vars (#289) (6201e28)
- command: fix description column definition in help text (#286) (bf727fb)
- command: highlight command usage in help text (#288) (7181724)
Chore
- upgrade: deno/std v0.112.0 (#291) (750d70d)
BREAKING CHANGES
command: execute command action after option action is called (#285) (9170a65)
Prior to v0.20.0, when an option action was executed, the command action was not executed. Since v0.20.0, this has changed. The command action is now executed by default. Only standalone options do not execute the command actions (for more informations the docs).
v0.19.6 (2021-09-23)
Features
- command: add noExit method (#282, #275) (bc0c5bb, ab38cc7)
- command: show long help with –help option (#281) (e577f5a)
- command: add usage method (#280) (a32755d)
Bug Fixes
- prompt: key symbols in prompt info are hardcoded (#274) (a6138b2)
Documentation Updates
- fix typos (#279) (d802a15)
- command: fix incorrectly import module (#276) (6674ea3)
- command: fix import path (#271) (57e7434)
v0.19.5 (2021-08-12)
Features
- command: support import map in upgrade command (#265) (b400131)
- command: add support for required env vars (#261) (ee69526)
- command: make parsed environment variables available via command options (#263) (102161e)
- command: add prefix to environment variable options (#268) (44c80c8)
await new Command<void>()
.env<{ outputFile?: string }>(
"CC_OUTPUT_FILE=<value:string>",
"The output file.",
{ prefix: "CC_" },
)
.option<{ outputFile?: string }>(
"--output-file <value:string>",
"The output file.",
)
.action((options) => console.log(options.outputFile))
.parse();
$ CC_OUTPUT_FILE=foo.txt deno run example.ts
foo.txt
$ CC_OUTPUT_FILE=foo.txt deno run example.ts --output-file bar.txt
bar.txt
Bug Fixes
- command: output of –version should end with a new line (#256) (8107875)
Code Refactoring
- command: refactor executable sub-commands (#259) (a13c79f)
- command: remove extra new line from getHelp() and completion generator methods (#257) (99ccc2a)
- table: use console.log to render output (#258) (4f05fad)
Chore
- ci: update release workflow (65ba62a, 1c6dc9d)
- ci: add codecov config (#267) (c54627a)
- codecov: upgrade to codecov/codecov-action@v2 (#266) (18c023c)
- upgrade: deno/std v0.104.0 (#270) (15af5bf)
Documentation Updates
- update readme’s (#269) (83644f9)
- command: update docs for environment variables (f4cee28, 9d025fc)
- command: fix incorrectly import module in example (#262) (3e62ad6)
- command: update docs for executable sub commands (0b2f3d1)
v0.19.4 (2021-07-27)
Bug Fixes
- command,flags: equals sign not supported in option value (#253) (b074cb3)
- command,flags: values starting with ‘-’ not supported (#251) (ab598bf)
- command,flags: required option value with default value is not required (#249) (0d3f8fa)
- flags: allow collecting options by default if no flags are set (#252) (24e3f46)
Chore
- ci: add –jobs flag to speed up deno test’s (#250) (ce794cf)
- upgrade: deno/std v0.103.0 (#254) (ad65b8e)
v0.19.3 (2021-07-17)
Features
- prompt: add prefix option (#233) (a4943cb)
Bug Fixes
- command: external commands not working on windows (#224) (84ac5be)
- command: remove v prefix from version in generated help text (#231) (f882abd)
- command,flags: don’t normalize arguments if stopEarly is enabled (#246) (2ea4938)
- prompt: use exit code 130 for ctrl+c (#242) (2c014d7)
Code Refactoring
- command: export github upgrade provider in upgrade/mod.ts (#232) (39a8075)
- prompt: replace deprecated Deno.copy with copy method from std/io (#243) (f95b317)
Chore
- ci: use denoland/setup-deno action (#219) (d93ad7d)
- ci: use latest deno version in release action (36c1c07)
- ci: upgrade eggs to v0.3.8 (1efd809)
- egg: add keypress module to egg.yaml (fee6ed4)
- upgrade: deno/std v0.101.0 (#244) (534094b)
Documentation Updates
- ansi: fix functional example command (#235) (f3103b9)
- command: fix type of args in stopEarly example (#240) (b909bc6)
v0.19.2 (2021-06-16)
Features
- command: add colors option to help options (#213) (eed2e90)
- table: add align option (#212) (9e10c9e)
Bug Fixes
- prompt: unicode characters are not displayed properly on windows (#216) (fb6a22e)
Code Refactoring
- flags: show better error message if an option occurs to many times (#215) (8b0dfcb)
Documentation Updates
- docs: add keypress module to cliffy.io (15fe4e0)
Chore
- update .gitignore (8053930)
- ci: remove deno 1.4.0 tests (#218) (f0e2ba8)
- upgrade: deno/std v0.99.0 (#217) (578cbda)
- upgrade: upgrade dev deps (#210) (d10f20d)
v0.19.1 (2021-05-30)
Bug Fixes
Documentation Updates
- changelog: fix commit links (8d8601f)
v0.19.0 (2021-05-26)
BREAKING CHANGES
keycode: refactor keycode module (#186) (4ac2719)
Before:
const key: KeyEvent = KeyCode.parse( "\x1b[A\x1b[B\x1b[C\x1b[D\x1b[E\x1b[F\x1b[H", );
After:
const key: KeyCode = parse("\x1b[A\x1b[B\x1b[C\x1b[D\x1b[E\x1b[F\x1b[H");
Features
command: add exitCode option to ValidationError (#201) (d4c0f12)
throw new ValidationError("Some validation error", 2);
command: add enum type (#197) (36289a2)
cmd.type("log-level", new EnumType(["debug", "info", 0, 1])) .option("-L, --log-level <level:log-level>");
command: improve support for generic custom types (#191) (59b1a93)
const color = new EnumType(["red", "blue", "yellow"]); cmd.type("color", color) // you can pass the type .option<{ color: typeof color }>("-c, --color <name:color>");
command: add upgrade command (#203) (348f743)
// single registry with default options cmd.command( "upgrade", new UpgradeCommand({ provider: new DenoLandProvider(), }), ); // multi registry with custom options cmd.command( "upgrade", new UpgradeCommand({ main: "cli.ts", args: ["--allow-net", "--unstable"], provider: [ new DenoLandProvider({ name: "cliffy" }), new NestLandProvider({ name: "cliffy" }), new GithubProvider({ repository: "c4spar/deno-cliffy" }), ], }), );
command: add values method to types to show possible values in help text (#202) (143eb1b, 045c56e)
command: allow numbers for completions (#195) (f30b3af)
command,flags: add integer type (#190) (2cc7e57)
cmd.option("-a, --amount <amount:integer>");
keycode: add code property to parse result (#182) (366683f)
keypress: add keypress module (#187) (5acf5db)
// promise const event: KeyPressEvent = await keypress(); // events keypress().addEventListener((event: KeyPressEvent) => { console.log("event:", event); if (event.ctrlKey && event.key === "c") { keypress().dispose(); } }); // async iterator for await (const event: KeyPressEvent of keypress()) { console.log("event:", event); if (event.ctrlKey && event.key === "c") { break; } }
prompt: add id option to automatically save suggestions to local storage (#204) (28f25bd)
await Input.prompt({ message: "Enter your name", id: "<local-storage-key>", });
Bug Fixes
- command,flags: value handler not called for default value if option is not defined on commandline (ef3df5e)
- keycode: fix esc key and sequence property for escaped keys (b9eb39b)
- table: fix getBody and hasHeaderBorder methods (2d65cc8)
Code Refactoring
- command: add CompleteHandlerResult type (#200) (ade3c3d)
- command: remove unnecessary dependency (#199) (b26f07c)
- flags: refactor number type (#196) (9b57f54)
- flags: refactor error message for boolean and number types (#189) (2a19c34)
- keycode: refactor special key handling (7aaaec4)
- prompt: enable raw mode only if stdin is a tty (#183) (83c644a)
Chore
- ci: upgrade to eggs@0.3.6 (7a8e3dd)
- upgrade: deno/std v0.97.0 (#207) (37dc946)
Unit/Integration Tests
- flags: fix value tests (5ec86e8)
- prompt: add integration tests (#172) (0031490)
- table: add more tests (3dd6315)
Documentation Updates
- command,flags: add integer type to readme (6aec3db)
- command: fix typo (a965ea3)
- command: describe getHelp and showHelp (0e674c8)
- command: documentation fixes (6442ae7)
v0.18.2 (2021-04-14)
Features
Bug Fixes
- ansi: make getCursorPosition options optional (#164) (2e7c35d)
- command: fix typo in completions command help (#175) (c9f110a)
- command: fix shell completion of default types (#168) (e976378)
- command: command alias not working (#167) (45fc678)
Chore
- fix lint errors (#176) (ebccd05)
- ci: add release workflow (#173) (d7f24dc)
- ci: fix nightly tests (#171) (6e55b57)
- upgrade: deno/std v0.93.0 (#177) (d758012)
Unit/Integration Tests
- ansi: add more tests (#163) (e91d651)
- command: add integration tests (#169) (37b07e9)
- command: add more tests (#166) (298d5e0)
Documentation Updates
v0.18.1 (2021-03-15)
Bug Fixes
- prompt: adopt prompts to work with enabled ts option useDefineForClassFields (#162) (ac6ce0e)
Chore
Documentation Updates
v0.18.0 (2021-03-07)
Features
- command: add improved support for generic types (#151, #157, #159) (f43a7f1, e143799, 406afc2)
- command: add globalOption, globalType, globalComplete and globalEnv alias method’s (#152) (e1a6bb2)
- prompt: improve search and auto suggestions (#153) (6597205)
Bug Fixes
- command: help callback does not work with global options and commands (#149) (0972cc0)
Chore
- egg: ignore .DS_Store files (84fba89)
- upgrade: deno/std v0.89.0 (#158) (3ecd38e)
Documentation Updates
- fix ci badges (#156) (bc93ae5)
v0.17.2 (2021-02-08)
Features
- flags: add option callback method (#147) (246035c)
Bug Fixes
- command: option action not executed for options with no value (#148) (c436221)
v0.17.1 (2021-02-07)
Bug Fixes
- command: actions on hyphenated options won’t run (#144) (1ee0366)
- prompt: clear stdout on ctrl+c (#142) (1e15d38, a6b5d36)
- prompt: disabled item gets selected when it’s the first option (#137) (f5c9be5)
Code Refactoring
- use object spread instead of Object.assign (22681f0)
- command,flags: make options.flags an array (eeac740)
Chore
- upgrade: deno/std v0.86.0 (#146) (ce54da4)
Documentation Updates
v0.17.0 (2021-01-11)
Features
- ansi: add a chainable (chalk like) ansi colors module (#128) (f2d8c93)
- command: make generated help customizable (#134) (0cfceb7)
- command,flags: add did-you-mean support for improved error messages (#131) (afd8697)
- prompt: add cbreak option to support custom signal handling (#106) (a637b54)
- prompt: add auto suggestion support to Input, Number, Confirm and List prompt’s (7dd6660, a67dc53)
- prompt: add search option to Select and Checkbox prompt (7d09739, a67dc53)
- prompt: add info option to all prompts with a select or suggestions list (c7bfce6)
- prompt: add pageup and pagedown keys to all prompts with a select or suggestions list (44575e3)
Code Refactoring
- flags, command: improve error handling and unify error messages (#133) (8c7789b)
- command: refactor hints formatting in help output (#130) (ed588e2)
- prompt: refactor indent option (ad7923f)
- prompt: refactor internal keypress event handling (37fcbaf)
Documentation Updates
- update documentations and add new example gifs (4dc9991, 87223aa, df45bd8, 5d060b0, 99153ba, 2383f5b)
BREAKING CHANGES
- ansi: re-write ansi_escape module and rename to ansi (#124) (41a39d0)
- command: rename help method to showHelp (0cfceb7)
v0.16.0 (2020-12-09)
Features
- table: add static
Table.chars()
method to set global default table characters (#107) (fec09df)
Bug Fixes
- keycode: f1-f4 + shift returns undefined key name (#111) (112c0b5)
- prompt: fix default value of select prompt (#123) (3a97617)
- prompt: wrong cursor position on windows (#114) (0e14b51)
- prompt: remove async modifer from abstract method declartion that breaks cliffy on deno 1.6 (#122) (63351d0)
Code Refactoring
- command: remove duplication description from completions command (#118) (d116c73)
- prompt: refactor prompt’s (#122, #120, #119, #117) (63351d0, 2fda6e0, b5ecced, f4ca0bb)
Chore
Documentation Updates
v0.15.0 (2020-10-24)
Features
- flags,command: add support for dotted options (#104) (9cd1191)
- flags,command: improve support for negatable options (#103) (220dcea)
v0.14.3 (2020-10-18)
Bug Fixes
- command: optional arguments are validated even if they are not specified on the command line (#101) (e3d61d7)
- command: zsh completion values not separated by new line (#98) (a89ccc6)
- flags,command: single dash not supported in arguments (#100) (5b30372)
Chore
- fix nightly tests (#97) (e0093b7)
- ci: set deno version to v1.x (c01396c)
- egg: use unstable instead of deprecated stale option (1e579b2)
- lint: fix lint errors (2ca7bb6)
- upgrade: deno/std v0.74.0 (32f01e0)
v0.14.2 (2020-10-05)
Features
Bug Fixes
- command: spaces not supported in bash completions (#94) (95b29b2)
- command: spaces not supported in zsh completions (#93) (e9805b6)
- command: prompt method not exported from prompt/mod.ts (cd0d122)
Code Refactoring
- use underscore in file names (#92) (357db7f)
- command: indent zsh completions script with 2 spaces (310bc00)
Chore
- ci: add separate workflows for test and nightly-test (d8ecece)
- ci: update deno version to v1.4.4 (20c45f3, 689fe20)
- upgrade: deno/std v0.73.0 (bfad89b, 5dbe353)
v0.14.1 (2020-09-13)
Bug Fixes
- command: quotes and brackets in option description breaks shell-completion (#82) (7907413)
- command: only generate argument completions for types that have completions (#81) (1998108, 8040abf)
Chore
- ci: update deno version to v1.4.0 (e1515b9, 1e15d43)
- lint: fix lint errors (2dd4be9)
- ts: use import/export type for types (fbcff11)
- upgrade: deno/std v0.69.0 (bfadcc1, 9bdd341)
v0.14.0 (2020-09-02)
Features
- command: add bash completions support (#78) (09c0fc2)
- command: implement argument types validation (#70) (01acb53)
Bug Fixes
- command: fix complete command error “No type registered with name: action” (#77) (f2c6bea)
- command: fix shell completion bug which occurs when an option has only one flag (9fbef68)
- command: fix shell completion bug which occurs when the conflicts option is defined without dashes (2dfa8b1)
- command: default command ‘help’ not found error on completions command (580bacd)
- command: fix typo in error message (2fa9d29)
Code Refactoring
- use stripColor from deno/std (56bcc89)
Style
- command: fix jsdoc formatting (230cac7)
Chore
- fix test workflow name (0e683c1)
- use deno fmt for code formatting (#71) (e7dd856)
- ci: run shellcheck on bash/zsh completion scripts (#79) (40f2dc9)
- ci: add deno lint step (e48f293)
- ci: split workflows, add nightly test and lint workflow (#72) (d13af64)
- ci: update deno version to v1.3.2 (a8d6a60)
- lint: fix lint errors (25d8e24, 92c84ac)
- upgrade: deno/std v0.67.0 (43204a5)
Documentation Updates
- add contribution guidelines (#73) (afe47ff)
v0.13.0 (2020-08-25)
Features
- prompt: add support for prompt list and dynamic prompts (6968c1d)
Bug Fixes
- flags: standalone parameter incompatible with dashed parameter which has a default value (1aa9b55)
- prompt: cursor not visible after error (1de8a84)
Performance Improvements
- command,flags: implement simple camel-case and remove param-case and snake-case methods to improve performance (20dc077, 4587284)
Code Refactoring
- remove format utils method (2496431)
- refactor project structure for url friendly imports (8b5fbdd)
- ansi-escape: add return types (2bb165c)
- command: re-export flag types in command module and some refactorings (05b3c9e)
- command: refactor error message (6f6e750)
- command: remove some helper methods: write, writeError, log, logError from command class (88bdc95)
- command: refactor completions command description and disable unimplemented bash completions command (a181cbb)
- command: add version option only if version is set (32e6687)
- prompt: remove read-line module and move methods to generic prompt class (dd1de10)
Style
- ansi-escape: add semicolons (7ed6424)
Chore
Documentation Updates
BREAKING CHANGES
command: refactor external sub-commands (#66) (6181747)
Following line no longer registers an external command.
```typescript new Command() .command("sub-command", "description..."); // // is same as new Command() .command("sub-command") .description("description..."); ```
To register an external command you have to use the
.external()
method for now.```typescript new Command() .command("sub-command", "description...") .external(); // is same as new Command() .command("sub-command") .description("description...") .external(); ```
command,flags: refactor type handler (bf12441)
To make types compatible with environment variable and arguments the arguments of the type handler has changed from:
```typescript const myType: ITypeHandler<number> = ( option: IFlagOptions, arg: IFlagArgument, value: string, ): number => {}; ```
to:
```typescript const myType: ITypeHandler<number> = ( { label, name, value, type }: ITypeInfo, ): number => {}; ```
This makes it possible to write a single error messages for different contexts.
```typescript throw new Error(`${label} ${name} must be of type ${type} but got: ${value}`); ```
For options the error message will be:
Option --my-option must be of type number but got: abc
For environment variables the error message will be:Environment variable MY_ENV_VAR must be of type number but got: abc
For arguments the error message will be:Argument my-argument must be of type number but got: abc
command,flags: rename some types (0645313)
- ICompletionSettings -> ICompletion
- IArgumentDetails -> IArgument
- ITypeOption -> ITypeOptions
- ITypeSettings -> ITypeInfo
- IEnvVariable -> IEnvVar
- IEnvVarOption -> IEnvVarOptions
table: rename min/maxCellWidth to min/maxColWidth (#65) (c75b94c)
v0.12.1 (2020-08-03)
Bug Fixes
- remove “v” prefix from deno std url (#57) (10c951a)
v0.12.0 (2020-08-01)
Features
- table: add support for
rowSpan
(9c05cc3) - table: add support for
colSpan
(bb6cae9) - table: add
.fromJson()
method (4be3edd) - table: add support for enabling and disabling border per row and cell (d62182d)
- table: add
.body()
method toTable
(2526ff2) - table: make border chars customizable (866b71e)
Bug Fixes
- keycode:
KeyCode.parse(data)
captures only the first character (#54) (f153909) - prompt: pasting clipboard into prompt returns corrupted data (#54) (5de866c)
- prompt: show option name instead of value as result with select and checkbox prompt (#53) (1d81235)
- prompt: cursor not visible after exiting with
ctrl + c
(110a07e) - table: remove trailing line break from
.toString()
method (3af8850)
Code Refactoring
- table: set default table padding to
1
(a6e6aa3) - table: reformat table (16ae13d)
- table: add
TableLayout
class (699c0d1) - table: refactor
.from()
and.clone()
method’s (ddee9d7)
Chore
- ci: update deno version to v1.2.2 (3dd48e0, 90f670a)
- nest: update version to v0.12.0 (6e212a2)
- deno: update deno/std version to v0.63.0 (82c3eae, adc84c4)
Unit/Integration Tests
- table: add colspan and rowspan test’s (d8df570)
Documentation Updates
- fix license link (96988d2)
- changelog: fix changelog versions (6e71754)
- keycode: update keycode example (ae01931)
- table: update readme and examples (e837b71, df18516)
v0.11.2 (2020-07-22)
Features
- prompt: add support for custom keys (5df1f95)
Code Refactoring
- prompt: add fallback keys for unsupported keys on windows (#47) (71f54f5)
- prompt: extend Toggle prompt from GenericPrompt (#50) (cfe2064)
v0.11.1 (2020-07-15)
Bug Fixes
- prompt: fix default value (#48) (805f5a1)
v0.11.0 (2020-07-14)
Features
- command: add
.versionOption()
and.helpOption()
method’s (85d66b9)
Code Refactoring
- remove
IGenericObject
interface (e3c8660) - command: remove
OptionType
type fromIArgumentDetails
(c8dc229) - command: refactor
ICommandOption
interface (88263b5)
Chore
- deno: update deno/std to v0.61.0 and deno ci version to v1.2.0 (#45) (f23da64)
- nest: add
egg.yaml
config (f8447cc)
Unit/Integration Tests
- command: fix depends test (9ec513c)
Documentation Updates
- command: fix options type in action handler example’s (#44) (d661cc4)
v0.10.0 (2020-06-30)
Breaking Changes
command: remove
BaseCommand
class (#27) (029aac5, 2bc4660)All commands have to be created with the
Command
class for now. Thehelp
andcompletions
commands are now optional and can be registered as descripted in the example below. The--help
and--version
option will be registered only on the main command for now. The--help
option is a global option and available on all child-command’s.```typescript import { Command, CompletionsCommand, HelpCommand, } from "https://deno.land/x/cliffy/command.ts"; await new Command() .command("help", new HelpCommand()) .command("completions", new CompletionsCommand()) .parse(); ```
command: remove optional argument from boolean flags which was registered per default (#40) (94ea644)
An option defined with
.option('-d, --debug', '...')
has no longer an boolean argument per default. To add an boolean argument you have add the argument explicitly with.option('-d, --debug [arg:boolean]', '...')
flags: remove optional argument from boolean flags which was registered per default (#40) (00ac846)
A boolean flag no longer has an optional value per default. To add an optional or required value use the
optionalValue
orrequiredValue
option.
Features
- command: add
prepend
option to.option()
method (5164692) - command: add
.getGlobalParent()
method (a1d61c9) - command: pass command to completion handler (1e8d51b)
- command: add support for function as description parameter (8dfe004)
- command: add
.getParent()
and.getMainCommand()
method’s (1a900be) - command: make executed command accessible with
this
in action handler (#28) (461145f) - flags: add support for shorthand flag’s with value e.g.
-n5
results in{n: 5}
but-abc
will still result in{a: true, b: true, c: true}
(775c528) - flags: add support for equal sign in flags e.g.
--foo=bar
(53ba110)
Bug Fixes
- command:
getGlobal*
methods does not return all globals (c7f5a5a) - prompt: hide cursor in
Secret
prompt only ifhidden
is enabled (5ebf343)
Code Refactoring
- command: refactor help command (6269e1b, d3c2fa1)
- command: remove
DefaultCommand
class (#27) (9e3913c, 9cdc2d2) - command: make command properties private (7d5e318)
- command: don’t reset child commands with
.reset()
method (ba85b2a) - command: refactor completions command (5e07fff)
- command: add
ArgumentsParser
util class (c30e474) - command: pass parent command to completion handler (8e4167f)
- command: make
.complete()
method optional in custom type’s (53a9af7) - prompt: remove generic options from
Select
prompt (a694881) - prompt: remove unused
Separator
class (31b41e4)
Chore
Documentation Updates
- command: update readme and example’s (0918d76, 9b76c92, ae371d9, fe9e06c, ddd8208)
- flags: update readme and example’s (5ed1ec7)
- prompt: update readme and example’s (edfae8b)
v0.9.0 (2020-06-05)
Features
- command: implement
.stopEarly()
method (#39) (45f28e7) - command: add
.getRawArgs()
method (4f18db7) - command: return
literal
arguments in.parse()
method and add.getLiteralArgs()
method (#26) (385f38f) - flags: implement
stopEarly
option (#39) (ee683d3) - prompt: add
minOptions
andmaxOptions
option’s toCheckbox
prompt (#38) (0980b42) - prompt: add
minLength
,maxLength
,minTags
andmaxTags
option toList
prompt (#37) (6836a7d) - prompt: add
label
option toSecret
prompt (9127471) - prompt: add
minLength
andmaxLength
toInput
andSecret
prompt’s (#36) (2b13fab) - prompt: add secret prompt (#35) (9aaa740)
Chore
- ci: update deno version to v1.0.5 (bb2eb25)
v0.8.2 (2020-05-30)
Bug Fixes
- table: table fails if word is longer than maxCellWidth (#34) (b6c5f07)
Code Refactoring
- prompt: remove
undefined
return type from.prompt()
method’s (#25) (15f707a) - table: remove unused method (6d00cc3)
v0.8.1 (2020-05-29)
Bug Fixes
- prompt: ignore ctrl and meta keys in input prompt’s (1f266b6)
- prompt:
c
character is not working in input prompt’s (a0d6545)
v0.8.0 (2020-05-29)
Features
- command: add support for global and hidden environment variable’s (9e98940)
- command: add support for global command’s (ec42c7a)
- command: add support for global completion’s (1d814e2)
- command: add support for global type’s (91c1569)
- command: add support for global option’s (#2) (7d6e7cf)
- command: make
args
parameter optional in.parse()
method (fabfd32)
Code Refactoring
- command: remove
ICommandMap
interface (eb3f578)
v0.7.1 (2020-05-24)
Bug Fixes
- command: help command fails with registered environment variables (#31) (b176bd4)
Chore
- ci: test’s in
packages/command/test/command
were not executed (2436fd2)
v0.7.0 (2020-05-22)
Features
- command: add support for hidden options’s #23 (42f701f)
- command: add support for hidden command’s #22 (1866b75)
- command: add
.getHelp()
method toHelpCommand
(9b96d10) - command: add
.name()
method and refactor internal name and path handling (#21) (362d8ea) - command: make arguments generic (8a153a7)
- command,flags: make options generic (09a3d00)
Bug Fixes
- command: environment variables are always invalid (fa131eb)
- command: separator option is ignored (0405244)
- command: default option incompatible with standalone option (e9e6aa5)
- command: depends info is not shown in help output (0e2e860)
- command,keycode:
CLIFFY_DEBUG
does not work (4e90d77) - flags: standalone option could be combined with options whose value is optional and has a default value (5cd8287)
- flags: standalone option could be combined with another standalone option (cb91b85)
- keycode: fix compile error which happened with deno v1.0.1 (dcfa470)
- keycode: remove doublicate export of
IGenericObject
(28fd483)
Code Refactoring
- use encoding/utf8 for text encoding (81d4b04)
Chore
- ci: fix typo (33ca82c)
- ci: update deno version to v1.0.1 (2f25d8b, fd98c80, 15f55ae)
- deno: update deno/std to v0.52.0 (4b354cd)
Documentation Updates
- fix issues link (c64282e)
- command: add executable example commands (8fbe263)
- command: add documentation and example’s for hidden command’s and option’s (0c2f400)
- command: add generic types example and documentation (0998f55)
- prompt: fix prompt example (90f8595)
BREAKING CHANGES
- command: rename
IFlagsParseResult
toIParseResult
(eaeb634)
v0.6.1 (2020-05-12)
Bug Fixes
- add missing entry files and module exports for prompt & keycode module #19 (f16863d)
v0.6.0 (2020-05-11)
Code Refactoring
- command: make command’s executable without –allow-env flag #11 (03117ed)
- x: make format executable without –allow-env flag #11 (2db057e)
Chore
- add support for deno v1.0.0-rc2 (acb84e1)
Documentation Updates
- update readme’s (7e549c9)
BREAKING CHANGES
- prompt: prompt requires the –unstable flag to work with deno >= v0.42.0 (6cd9d3f)
v0.5.1 (2020-05-03)
Bug Fixes
- flags: default option incompatible with depends option and boolean flag’s (b76a9a7)
v0.5.0 (2020-05-03)
Features
- ansi-escape: add
ansi escape
module (#1) (0ac92c2) - keycode: add
keycode
module (f61d033, 3be5b72, 9869720) - prompt: add
prompt
module (#4) (df2221e)
Code Refactoring
- use explicit version of deno std module’s (fcdf97a)
- use utf8 encoding module instead of
TextEncoder
for text encoding (b29e1ba) - command: use new
Table
class in help command (5f203d1)
Chore
Documentation Updates
BREAKING CHANGES
table: rewrite table module (65988b7)
Old table method’s like
table
andrenderTable
are replaced by the newTable
class.
v0.4.0 (2020-04-04)
Features
- command: add zsh completions support (9493d90, f54d3a2)
- command: add
complete
sub-command tocompletions
command (fb63ec7) - command: add complete method for custom auto completions (7d5d25e, 9406a84, 5ce209d)
- command: complete command names on help command (5897be1)
- command: add
action
type (164585e) - command: add
command
type (2b9608c) - command: add autocompletion for types (16d5237)
- flags: support method as option default value (ce09421)
- table: add
border
option (a785164)
Bug Fixes
- flags: fix default value (0244b50)
Code Refactoring
- command: export default types (34fcddd)
- command: make
complete
method in custom type class’s optional. (253cd74) - command: update
completions
description (a3c5c72) - flags: refactor
validateFlags
method (2b51730) - flags: refactor
getOptions
method (3927c36)
Chore
Unit/Integration Tests
- command: update sub-command test (0939b6d)
- command,flags: don’t call
Deno.runTests()
in test’s (57f3a34) - flags: refactor test’s (cf97a15, c021659)
- flags: add value test (6e3bc57)
- flags: add default value test (2fbfd54)
- flags: add collect test (3c14011)
Documentation Updates
BREAKING CHANGES
command,flags: rename
requires
option todepends
(c937466)To define depending options you have tu use the options
depends
instead ofrequires
now.command,flags: call
parseValue
only if the flag has a value (ab5ba30)Change type of
value
param fromType.parse()
method fromstring | false
tostring
v0.3.0 (2020-03-31)
Features
- add support for deno v0.38.0 (80d7ba4, 9824899, 26b58be)
- command: add support for custom type class’s (7006a67)
- flags: add
parse
and removetypes
option to simplify custom types (d1bc510)
Bug Fixes
- command: suppress
Missing argument(s)
error for standalone options (47b162e) - command: fix
IArgumentDetails
andIOption
interface (52193e5)
Code Refactoring
- command: change type of commands from Array to Map (52f7e1f)
- command: refactor sub-command helper methods (d6d1b05)
- command: refactor internal args handling and add some args helper methods (957347e)
Documentation Updates
v0.2.0 (2020-03-23)
Features
- command: validate environment variables (179ef30)
- command: add support for custom types (fbfea55)
- flags: add
parseFlagValue()
method (1983bd1)
Code Refactoring
- command: refactor
env()
method (a1a3364) - command: print help when the
completions
command is called without arguments (b2c4f91) - command: update description of
completions
command (5feeb77) - command: update description of
help
command (15a3fd5) - command: print only first line of description in options and command list (8cf33a1)
- command: exit program after help and version is printed (05bc677)
- flags: refactor
string
type (6900462) - flags: refactor
boolean
type (10997f6) - table: refactor
table
method (8228ac1)
Documentation Updates
v0.1.0 (2020-03-18)
- add entry points (e86d44e)
Features
- command: add
command
module (3f95ec6, 789faa3, bf3a20c, 148c810, d2faa96) - flags: add
flags
module (7eaab8b) - table: add
table
module (e05aaa3)