You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/docs/commands.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ Available commands:
91
91
Running `myexe commit --help`:
92
92
93
93
```
94
-
Usage: myexe commit [options] [<files>]...
94
+
Usage: myexe commit [options] <files>*
95
95
96
96
Options:
97
97
-m, --message=MESSAGE Commit MESSAGE
@@ -306,12 +306,14 @@ If no version string is provided, it extracts the version from the assembly's in
306
306
307
307
Understanding the parsing flow helps debug complex scenarios:
308
308
309
-
1. Parse options (tokens starting with `-`, `--`, or `/`), applying option callbacks as values are consumed.
310
-
2. If sub-commands exist and a token matches a sub-command name, dispatch to that sub-command.
311
-
3.Parse positional arguments (`CommandArgument`) for the selected command.
309
+
1. Parse options for the current command (tokens starting with `-`, `--`, or `/`), applying option callbacks as values are consumed.
310
+
2. If help/version is requested for the current command, stop and render output.
311
+
3.Apply environment-variable fallbacks for options not set on the command line.
312
312
4. Run option constraint checks (mutually exclusive, requires).
313
-
5. Invoke the command action and return its exit code.
314
-
6. On error, the error is reported to `Error` and `RunAsync` returns `1`.
313
+
5. If sub-commands exist and the next token matches an active sub-command, dispatch to that sub-command and repeat.
314
+
6. Parse positional arguments (`CommandArgument`) for the resolved command.
315
+
7. Invoke the command action and return its exit code.
316
+
8. On error, the error is reported to `Error` and `RunAsync` returns `1`.
315
317
316
318
If the parser is currently expecting a value for an option, the next token is **always** consumed as that value — even if it looks like `--` or matches a sub-command name.
0 commit comments