-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Comparing changes
Open a pull request
base repository: tj/commander.js
base: v6.2.1
head repository: tj/commander.js
compare: v7.0.0
Commits on Sep 9, 2020
-
Expand help customisation with .addHelpText (#1296)
* Add new help events * Add context for new help events * Rename and use help context * Suppress help output * Slight tidy of legacy callback handling * Shift help contextOptions up to public API * Fix some spelling errors * Start adding tests. Fix groupHelp. * Test help event order * Add tests on context * Add missing semicolon * Add context.error tests * First cut at README adding events and removing callbacks * Add typings and parameter descriptions * Change from --help to postHelp event * Update and add custom help examples * Make help listener example more realistic * Update example * Call the old callback, deprecated * First cut at .addHelp() * Change name to addHelpText * First round of tests for addHelpText * Simplify help event context, remove log * Assign write directly * Add end-to-end and context checks for addHelpText * Put back write wrapper to fix unit test * Fix write mocks for help-as-error output * Ignore falsy values for AddHelpText * Remove the help override from addHelpText as not good fit * Convert example to addHelpText * Update README * Add info about new .help param * Remove excess space * Update more examples * Remove references to override * Update docs with .addHelpText
Configuration menu - View commit details
-
Copy full SHA for d26a26d - Browse repository at this point
Copy the full SHA d26a26dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8afc0ba - Browse repository at this point
Copy the full SHA 8afc0baView commit details
Commits on Sep 14, 2020
-
Enhance Option class to allow hiding help, specifying choices, and ch…
…ange how default value displayed in help (#1331) * Add .addOption and use as bottleneck. Make all Option properties private. * Desription for object is optional * Add support for hidden options * Try setFoo for booleans so less ambiguous what no parameter means * Renamed method * Restore Option property names to reduce churn * Try more fluent names for non-property methods * Avoid renaming existing members of Option * Add default description for help * Fix return JSDoc * First cut at choices * Throw CommanderError for easier detection * Add catch for tidy coercion failure handing * Add tests for Option.choices * Rename custom option processing property * Add run script for TypeScript checkJS * Add tests for chaining routines * More consistent name for custom option arg processing * Add choices to help * .default() now expects parameter * Fixed return type * Separate out argumentRejected for possible reuse * Add back support for RegExp which accidentally dropped. * Add test for obsolete regexp * Add TypeScript definitions for new Option properties * Switch from obsolete to deprecated, clearer meaning * Fix left-over edit * Add comment * Simplify the comments * Add README and example file * Remove example covered elsewhere * Restore example, leave change for a separate PR * Fix example output to match changed code * Add language to code blocks * Rename getFullDescription, not using get much * Add chaining test for addHelpText * Describe as legacy rather than deprecated in comments, add @deprecated for editor feedback to discourage use * Do not have to have both should and long flags these days * Eliminate duplicate code using internal knowledge * Rename parseArgWith to argParser * Improve JSDoc for help * Make code and declarations consistent to pass tsc checks * Match up write signature to fix linting error * Restore "deprecated", it is the right word
Configuration menu - View commit details
-
Copy full SHA for a05a8bc - Browse repository at this point
Copy the full SHA a05a8bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 091224d - Browse repository at this point
Copy the full SHA 091224dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9abb793 - Browse repository at this point
Copy the full SHA 9abb793View commit details
Commits on Sep 26, 2020
-
Deprecated functionality (#1349)
* Add documentation on deprecated routines * Tidy up deprecated and link from README.
Configuration menu - View commit details
-
Copy full SHA for 9f5aabc - Browse repository at this point
Copy the full SHA 9f5aabcView commit details -
Configuration menu - View commit details
-
Copy full SHA for e5512a4 - Browse repository at this point
Copy the full SHA e5512a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for b4fbe67 - Browse repository at this point
Copy the full SHA b4fbe67View commit details
Commits on Oct 18, 2020
-
Configuration menu - View commit details
-
Copy full SHA for b0c5884 - Browse repository at this point
Copy the full SHA b0c5884View commit details
Commits on Oct 23, 2020
-
Refactor help internals into separate interface/class (#1365)
* Start filling out HelpUtils to try pattern * Shift the largestFoo routines into helper * Update generation of Commands section of help * Rework helpInformation in consistent new style * Remove unused routines * Make columns part of HelpUtils * Offer a light weight override to HelpUtils * Tweak comment * Add chain test for helpUtilOverrides * Add itemIndent as another proof of concept of allowing overrides * Avoid Utils contraction * Update comments * Switch columns from function to data property * Remove itemIndent(), not useful enough alone or as a pattern for now * Make _helpToolsOverrides inherited * Improve naming for termWidth * Move usage into HelpTools * Add term and description routines to HelpTools so symmetrical pattern * Name the magic numbers * More consistent naming * Remove reference to removed routine * Move help formatting into HelpTools * Fix typescript-checkJS errors * Simpler naming * Slightly simplify code * Add getter/setter to assist overrides * Add sort overrides * First cut at TypeScript definitions for Help, no TSDoc yet * Replace pad and low level indents with modern calls * Rename and rework type for HelpConfiguration * Combine optionalWrap and wrap * Add createHelp to TypeScript definition * Add test-all script * More carefully make concrete help option for displaying * Fix test with valid parameters for custom help * Start adding Help tests * Add largestCommandTermLength tests * Add more Help tests * Add commandUsage tests * Add test for commandDescription * Add missing Command properties, and default description to empty string * Add tests for optionDescription * Add padWidth tests * Add sort tests * Add columns and wrap tests * Add test for legacy commandTerm behaviour * Add TypeScript usage tests for Help * Refactor Help tests into separate files * Add tests for createHelp and configureHelp * Add JSDoc for Help. Rename methods. Delete @api public as default. * Add TSDoc for Help * Test special caes of implicit help flags * Clarify method naming * Shift the Usage prefix into formatHelp * Add Help class mention and reorder help * Add simple configure-help example * Add example file to README * Rename to sortSubcommands to match other naming * Do not weaken configuration type, user can extend as required * Do not cache implicit help command calculation so safer (no need, not being thrashed) * Add JSDoc for configureHelp * Add TSDoc * Add missing TSDoc * Switch option sort to use attributeName, with negative after positive * No need for string template literal * No need for string template literal
Configuration menu - View commit details
-
Copy full SHA for 19ae912 - Browse repository at this point
Copy the full SHA 19ae912View commit details -
Configuration menu - View commit details
-
Copy full SHA for d90ef12 - Browse repository at this point
Copy the full SHA d90ef12View commit details -
Configuration menu - View commit details
-
Copy full SHA for 800955e - Browse repository at this point
Copy the full SHA 800955eView commit details
Commits on Oct 25, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 5911197 - Browse repository at this point
Copy the full SHA 5911197View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0703a4d - Browse repository at this point
Copy the full SHA 0703a4dView commit details
Commits on Oct 26, 2020
-
Update testing node versions, supported node versions, and archive 4.…
…x CHANGELOG entries (#1385)
Configuration menu - View commit details
-
Copy full SHA for 033e6d9 - Browse repository at this point
Copy the full SHA 033e6d9View commit details -
* Add createOption (like createCommand and createHelp) * Add tests * Add TypeScript * option description is optional
Configuration menu - View commit details
-
Copy full SHA for b1d984b - Browse repository at this point
Copy the full SHA b1d984bView commit details -
Increase test coverage (#1381)
* Test passing parameter to allowUnknownOptions * Test negated option in help
Configuration menu - View commit details
-
Copy full SHA for 7a0baab - Browse repository at this point
Copy the full SHA 7a0baabView commit details -
Configuration menu - View commit details
-
Copy full SHA for df5d679 - Browse repository at this point
Copy the full SHA df5d679View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b98fc8 - Browse repository at this point
Copy the full SHA 5b98fc8View commit details
Commits on Nov 10, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 2f7aa33 - Browse repository at this point
Copy the full SHA 2f7aa33View commit details
Commits on Nov 17, 2020
-
* Add output configuration and use for version and errors * Tests passing using write/writeErr * Suppress test output on stderr using spyon * Accurately set help columns for stdout/stderr * Remove bogus file * Tidy comments * Only using single argument to write, simplify declaration to match * Add tests for configureOutput write and writeError * Add tests for configureOutput getColumns and getErrorColumns * Add error case too * Use configureOutput instead of jest.spyon for some tests * Add configureOutput to chain tests * Add set/get test for configureOutput * Rename routines with symmetrical out/err * Add outputError simple code * Add tests for outputError * Add JSDoc * Tweak wording * First cut at TypeScript * Add TypeScript sanity check for configureOutput * Add example for configureOutput * Add configureOutput to README * Make example in README a little clearer
Configuration menu - View commit details
-
Copy full SHA for ed7f13e - Browse repository at this point
Copy the full SHA ed7f13eView commit details
Commits on Nov 20, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 4555881 - Browse repository at this point
Copy the full SHA 4555881View commit details
Commits on Nov 21, 2020
-
Configuration menu - View commit details
-
Copy full SHA for eac4787 - Browse repository at this point
Copy the full SHA eac4787View commit details -
Configuration menu - View commit details
-
Copy full SHA for e3ad76d - Browse repository at this point
Copy the full SHA e3ad76dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e1a6cf4 - Browse repository at this point
Copy the full SHA e1a6cf4View commit details
Commits on Nov 25, 2020
-
Support custom error messages for option argument coercion failures (#…
…1392) * Make commander.optionArgumentRejected reusable * Add InvalidOptionArgumentError to simplify usage * Add TypeScript for InvalidOptionArgumentError * Add test for InvalidOptionArgumentError from custom option processing * Add InvalidOptionArgumentError to example and README
Configuration menu - View commit details
-
Copy full SHA for 689d7a0 - Browse repository at this point
Copy the full SHA 689d7a0View commit details -
* Use simpler more WYSIWYG sort of options * Do a WYSIWYG style sort
Configuration menu - View commit details
-
Copy full SHA for 9b087c8 - Browse repository at this point
Copy the full SHA 9b087c8View commit details
Commits on Dec 1, 2020
-
Improve backwards compatibility for command events (#1403)
* Improve backwards compatibility for command events * Implement tests for legacy command event
Configuration menu - View commit details
-
Copy full SHA for bd538aa - Browse repository at this point
Copy the full SHA bd538aaView commit details
Commits on Dec 4, 2020
-
Add .allowExcessArguments() and error message (#1407)
* Fix test file name * Add initial support for allowExcessArguments * Add TypeScript * Add tests * Refine error for program * Remove exception for legacy asterisk command, can disable if needed * Use defaulr parameters and simplify code
Configuration menu - View commit details
-
Copy full SHA for 09f277a - Browse repository at this point
Copy the full SHA 09f277aView commit details
Commits on Dec 5, 2020
-
Configuration menu - View commit details
-
Copy full SHA for f2f21f1 - Browse repository at this point
Copy the full SHA f2f21f1View commit details
Commits on Dec 6, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 1a3db74 - Browse repository at this point
Copy the full SHA 1a3db74View commit details -
Update dependencies in 7.x (#1412)
* Simplicy RegExp usage per lint * Update dependencies * Revert node change, do that elsewhere
Configuration menu - View commit details
-
Copy full SHA for 469acc9 - Browse repository at this point
Copy the full SHA 469acc9View commit details
Commits on Dec 9, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 1db83b6 - Browse repository at this point
Copy the full SHA 1db83b6View commit details
Commits on Dec 14, 2020
-
Change to safe storage of options by default, and change action param…
…eters (#1409) * First cut at storing options safely by default * Pass command as options for legacy behaviour * Update examples for new patterns * Rework README on using storeOptionsAsProperties * Tweak wording * Updat example for options-common * Update options-defaults * Update options-negatable example * Update options-boolean-or-value example * Update options-custom-processing example * Turn on error for excess arguments, and update tests accordingly * Add first cut at migration tips * Second cut at migration tips * Migration wording tweaks * Reworking README for new patterns * Goodbye to option properties on Command * Add migration tip for excess arguments * Minor improvements to migrations tips * Update examples for arguments * Update example for action handler * Add allowUnknownOption and allowExcessArguments to README * Update pizza example * Reuse pizza as single command example. Tidy up pizza and deploy. * Word change
Configuration menu - View commit details
-
Copy full SHA for f76bc71 - Browse repository at this point
Copy the full SHA f76bc71View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fd6e88 - Browse repository at this point
Copy the full SHA 5fd6e88View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b43f66 - Browse repository at this point
Copy the full SHA 4b43f66View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d95213 - Browse repository at this point
Copy the full SHA 5d95213View commit details
Commits on Dec 20, 2020
-
Update supported details for 7.x (#1419)
* Update supported versions * Slight reword to clarify node 10 is (just) minimum
Configuration menu - View commit details
-
Copy full SHA for 20cef03 - Browse repository at this point
Copy the full SHA 20cef03View commit details
Commits on Dec 21, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 75c2a63 - Browse repository at this point
Copy the full SHA 75c2a63View commit details
Commits on Dec 26, 2020
-
Configuration menu - View commit details
-
Copy full SHA for c09159d - Browse repository at this point
Copy the full SHA c09159dView commit details
Commits on Dec 27, 2020
-
Simplify eslint dependencies for TypeScript (#1425)
* Simplify TypeScript eslint dependencies * Remove comment * Build fresh package-lock
Configuration menu - View commit details
-
Copy full SHA for 5173665 - Browse repository at this point
Copy the full SHA 5173665View commit details
Commits on Jan 3, 2021
-
Increase test coverage, including incrementNodeInspectorPort (#1428)
* Add tests for incrementNodeInspectorPort * Fill out incrementNodeInspectorPort * Remove unused code from optionMissingArgument * Add tests for exit and custom throw * Error if call storeOptionsAsProperties with options already stored * Add test for bad params to parse * Error if parse "from" is unsupported * Can set alias after adding external command * Add test for invalid position to addHelpText * Clarify throw rather than display error * Add special case which displays help * Add test for incorrect return type on deprecated callback * Add test for implicit electron args * Add test for help requested on unknown subcommand * Add test for help suggestion including command path
Configuration menu - View commit details
-
Copy full SHA for d8faba2 - Browse repository at this point
Copy the full SHA d8faba2View commit details
Commits on Jan 4, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 1383870 - Browse repository at this point
Copy the full SHA 1383870View commit details -
* First cut at optionsBeforeArguments * Different to mix global options and subcommands, and options and arguments. * Different to mix global options and subcommands, and options and arguments. * Add _parseOptionsFollowingArguments * Use allow wording * Another try at naming * Exclude options from special processing, which fixes help * Add help checks for new option configuration * Rename after discovering needed for any positional options * Rework logic to hopefully cope with default commands. * Expand basic tests. Positional options are tricky! * Add first default command tests * Fill out more tests * Add setters, and throw when passThrough without enabling positional * Rename test file * Add TypeScript * Add tests. Fix help handling by making explicit. * Reorder tests * Use usual indentation * Make _enablePositionalOptions inherited to simpify nested commands * Add examples * Add tests for some less common setups * Test the boring true/false parameters * Fix typo * Add new section to README with parsing configuration. * Tweak wording in README
Configuration menu - View commit details
-
Copy full SHA for 8ac84ec - Browse repository at this point
Copy the full SHA 8ac84ecView commit details
Commits on Jan 7, 2021
-
Make new excess arguments error opt-in (#1429)
* Make allowExcessArguments opt-in (again) and inherited configuration * Remove stale JSDoc * Update documentation for allowExcessArguments being opt-in * Make comment more specific about what is being checked for excess arguments * Rework example class override
Configuration menu - View commit details
-
Copy full SHA for e2670f4 - Browse repository at this point
Copy the full SHA e2670f4View commit details
Commits on Jan 8, 2021
-
Configuration menu - View commit details
-
Copy full SHA for ff301fa - Browse repository at this point
Copy the full SHA ff301faView commit details
Commits on Jan 11, 2021
-
* Test for just flags and just description * Edge case test for wrap with trivial input * Add obscure edge case for coverage * Add test for variadic argument usage/help * Suppress tests that uncredited coverage and not currently chasing * Revert "Suppress tests that uncredited coverage and not currently chasing" This reverts commit d3c9146.
Configuration menu - View commit details
-
Copy full SHA for 891e23d - Browse repository at this point
Copy the full SHA 891e23dView commit details -
Configuration menu - View commit details
-
Copy full SHA for d934573 - Browse repository at this point
Copy the full SHA d934573View commit details -
ability to specify
minColumnWidth
forHelp.wrap
(#1430)* ability to specify `minColumnWidth` for `Help.wrap` * Added missing param in TypeScript for Help.wrap
Configuration menu - View commit details
-
Copy full SHA for fcc8988 - Browse repository at this point
Copy the full SHA fcc8988View commit details -
Configuration menu - View commit details
-
Copy full SHA for 182ee06 - Browse repository at this point
Copy the full SHA 182ee06View commit details
There are no files selected for viewing
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.