Skip to content

Commit eff875f

Browse files
committed
docs: add add_parent() and confirmation_option() to Builder Method Compatibility
1 parent 185c629 commit eff875f

File tree

1 file changed

+44
-37
lines changed

1 file changed

+44
-37
lines changed

docs/user_manual.md

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,14 @@ Argument("name", help="...")
436436
║ ├── Response files
437437
║ │ command.response_file_prefix("@") enable @args.txt expansion ⁵
438438
║ │ command.response_file_max_depth[10]() max recursive nesting depth ⁵
439-
║ └── CJK / i18n
440-
║ command.disable_fullwidth_correction() disable fullwidth→halfwidth auto-fix
441-
║ command.disable_punctuation_correction() disable CJK punctuation correction
439+
║ ├── CJK / i18n
440+
║ │ command.disable_fullwidth_correction() disable fullwidth→halfwidth auto-fix
441+
║ │ command.disable_punctuation_correction() disable CJK punctuation correction
442+
║ ├── Argument inheritance
443+
║ │ command.add_parent(parent) copy arguments from a parent command
444+
║ └── Confirmation
445+
║ command.confirmation_option() add --yes/-y confirmation prompt
446+
║ command.confirmation_option["text"]() custom confirmation prompt text
442447
╚═══════════════════════════════════════════════════════════════════════════════
443448
```
444449

@@ -452,40 +457,42 @@ Argument("name", help="...")
452457

453458
The table below shows which builder methods can be used with each argument mode. **** = compatible, **** = not applicable.
454459

455-
| Method | Named value | `.flag()` | `.count()` | `.positional()` |
456-
| -------------------------------- | :---------: | :-------: | :--------: | :-------------: |
457-
| `.long["x"]()` |||||
458-
| `.short["x"]()` |||||
459-
| `.required()` |||||
460-
| `.default["val"]()` |||||
461-
| `.choice["a"]().choice["b"]()` |||||
462-
| `.range[min,max]()` |||||
463-
| `.clamp()` | ✓ ¹ ||||
464-
| `.append()` |||||
465-
| `.delimiter[","]()` | ✓ ² ||||
466-
| `.number_of_values[N]()` | ✓ ² ||||
467-
| `.map_option()` |||||
468-
| `.negatable()` |||||
469-
| `.max[N]()` |||||
470-
| `.value_name["FILE"]()`|||||
471-
| `.group["name"]()` |||||
472-
| `.hidden()` |||||
473-
| `.alias_name["alt"]()` |||||
474-
| `.deprecated["msg"]()` |||||
475-
| `.persistent()` |||||
476-
| `.default_if_no_value["val"]()` |||||
477-
| `.allow_hyphen_values()` |||||
478-
| `.remainder()` |||||
479-
| `.prompt()` |||||
480-
| `.prompt["msg"]()` |||||
481-
| `.require_equals()` |||||
482-
| `command.mutually_exclusive()` ³ |||||
483-
| `command.one_required()` ³ |||||
484-
| `command.required_together()` ³ |||||
485-
| `command.required_if()` ³ |||||
486-
| `command.implies()` ³ |||||
487-
488-
> ¹ Requires `.range[min,max]()` first. ² Implies `.append()` automatically. ³ Command-level method — takes argument names as strings, not chained on `Argument`. ⁴ Accepts compile-time parameter: `.value_name[wrapped: Bool = True]("NAME")``True` wraps in `<NAME>`, `False` displays bare `NAME`. ⁵ Response files temporarily disabled due to Mojo compiler bug.
460+
| Method | Named value | `.flag()` | `.count()` | `.positional()` |
461+
| --------------------------------- | :---------: | :-------: | :--------: | :-------------: |
462+
| `.long["x"]()` |||||
463+
| `.short["x"]()` |||||
464+
| `.required()` |||||
465+
| `.default["val"]()` |||||
466+
| `.choice["a"]().choice["b"]()` |||||
467+
| `.range[min,max]()` |||||
468+
| `.clamp()` | ✓ ¹ ||||
469+
| `.append()` |||||
470+
| `.delimiter[","]()` | ✓ ² ||||
471+
| `.number_of_values[N]()` | ✓ ² ||||
472+
| `.map_option()` |||||
473+
| `.negatable()` |||||
474+
| `.max[N]()` |||||
475+
| `.value_name["FILE"]()`|||||
476+
| `.group["name"]()` |||||
477+
| `.hidden()` |||||
478+
| `.alias_name["alt"]()` |||||
479+
| `.deprecated["msg"]()` |||||
480+
| `.persistent()` |||||
481+
| `.default_if_no_value["val"]()` |||||
482+
| `.allow_hyphen_values()` |||||
483+
| `.remainder()` |||||
484+
| `.prompt()` |||||
485+
| `.prompt["msg"]()` |||||
486+
| `.require_equals()` |||||
487+
| `command.mutually_exclusive()` ³ |||||
488+
| `command.one_required()` ³ |||||
489+
| `command.required_together()` ³ |||||
490+
| `command.required_if()` ³ |||||
491+
| `command.implies()` ³ |||||
492+
| `command.add_parent()` ³ |||||
493+
| `command.confirmation_option()` ³ |||||
494+
495+
> ¹ Requires `.range[min,max]()` first. ² Implies `.append()` automatically. ³ Command-level method — called on `Command`, not chained on `Argument`. ⁴ Accepts compile-time parameter: `.value_name[wrapped: Bool = True]("NAME")``True` wraps in `<NAME>`, `False` displays bare `NAME`. ⁵ Response files temporarily disabled due to Mojo compiler bug.
489496
490497
## Short Option Details
491498

0 commit comments

Comments
 (0)