File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,39 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
8
8
<!-- markdownlint-disable MD024 -->
9
9
<!-- markdownlint-disable MD004 -->
10
10
11
+ ## [ Unreleased] (date goes here)
12
+
13
+ ### Migration Tips
14
+
15
+ If you have a simple program without an action handler, you will now get an error if
16
+ there are missing command-arguments.
17
+
18
+ ``` js
19
+ program
20
+ .option (' -d, --debug' )
21
+ .arguments (' <file>' );
22
+ program .parse ();
23
+ ```
24
+
25
+ ``` sh
26
+ $ node trivial.js
27
+ error: missing required argument ' file'
28
+ ```
29
+
30
+ If you want to show the help in this situation, you could check the arguments before parsing:
31
+
32
+ ``` js
33
+ if (process .argv .length === 2 )
34
+ program .help ();
35
+ program .parse ();
36
+ ```
37
+
38
+ Or, you might choose to show the help after any user error:
39
+
40
+ ``` js
41
+ program .showHelpAfterError ();
42
+ ```
43
+
11
44
## [ 8.0.0-2] (2021-06-06)
12
45
13
46
### Added
You can’t perform that action at this time.
0 commit comments