Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More consistent way of adding command arguments #1490

Merged
merged 36 commits into from
Apr 8, 2021
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
39a47ed
added addArguments method
Niryo Feb 6, 2021
88a4cc5
fix undefined args
Niryo Feb 6, 2021
e8415ed
added tests, docs and typings
Niryo Feb 13, 2021
782f705
code review fixes
Niryo Feb 19, 2021
d106ca0
throw error on bad arg
Niryo Mar 6, 2021
39cb757
Parse command-argument details in constructor
shadowspawn Mar 13, 2021
8c4d8d0
Handle argument descriptions separately for legacy and new support
shadowspawn Mar 13, 2021
c2e0a5a
Add text to distinguish test names with .each
shadowspawn Mar 13, 2021
32f001b
Match nameAndArgs into two parts, rather than split on spaces.
shadowspawn Mar 14, 2021
4a8e323
Merge pull request #1 from shadowspawn/Niryo-addArgument
Niryo Mar 14, 2021
ad20e0b
Update release date post-release to be more accurate
shadowspawn Mar 22, 2021
9a77be4
Merge pull request #1467 from Niryo/addArgument
shadowspawn Mar 27, 2021
da37436
Fix test naming
shadowspawn Mar 27, 2021
81248e2
Simplify and tidy argument example
shadowspawn Mar 27, 2021
6052c14
Typing and typings test for .argument
shadowspawn Mar 27, 2021
0dd3547
Expand argument section to include existing multiple-argument approac…
shadowspawn Mar 27, 2021
0c43cd9
Add name method and improve Argument typings and tests
shadowspawn Mar 27, 2021
0dea8ac
Fix copy-and-paste JSDoc error
shadowspawn Mar 27, 2021
82ff5bd
Update example to match new method and README
shadowspawn Mar 27, 2021
a20a8fe
Deprecate old way of adding command argument descriptions
shadowspawn Mar 27, 2021
df73a19
Be lenient about Argument construction to allow lazy building
shadowspawn Mar 27, 2021
43ce351
Call first param to .argument "name", and expand jsdoc
shadowspawn Mar 28, 2021
af08a2b
Add low-level check that get same Argument from multiple ways of spec…
shadowspawn Mar 28, 2021
bac5ea9
Minor wording tweaks
shadowspawn Mar 28, 2021
0e505be
Add low-level tests for multiple arg variations
shadowspawn Mar 28, 2021
dac9656
Simplify test. Use .argument now.
shadowspawn Mar 28, 2021
3745659
Restore simple test, use .argument
shadowspawn Mar 28, 2021
a76f831
Big switch from .arguments to .argument in tests
shadowspawn Mar 28, 2021
5a08571
Expand help to explain argument variations
shadowspawn Mar 28, 2021
747d6ef
Keep Argument properties private for now (like Command, unlike Option)
shadowspawn Mar 29, 2021
b7def8a
Argument should follow Option for properties, make public again
shadowspawn Mar 30, 2021
f54d1ed
Generate help for arguments using same methods as for option and subc…
shadowspawn Mar 30, 2021
0879a1f
Simplify Argument .name(), just getter
shadowspawn Mar 30, 2021
1e66821
Expand test coverage for visibleArguments
shadowspawn Mar 30, 2021
ed7a1c8
Rework the multiple ways of specifying command-arguments
shadowspawn Apr 5, 2021
819616f
Add Argument to esm exports (and createOption)
shadowspawn Apr 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test naming
  • Loading branch information
shadowspawn committed Mar 27, 2021
commit da374365d3ebfab76d92232148b75671ddcb7743
2 changes: 1 addition & 1 deletion tests/args.badArg.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const commander = require('../');

test('should throw on bad argument', () => {
test('when unexpected argument format then throw', () => {
const program = new commander.Command();
expect(() => program.addArgument(new commander.Argument('bad-format'))).toThrow();
expect(() => program.argument('bad-format')).toThrow();
Expand Down