Skip to content

Commit 3413c6f

Browse files
committed
[docs] Add a users manual for core functionalities
1 parent 9556d73 commit 3413c6f

File tree

3 files changed

+556
-4
lines changed

3 files changed

+556
-4
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
A command-line argument parser library for [Mojo](https://www.modular.com/mojo).
44

5+
> **A**rguments
6+
> **R**esolved and
7+
> **G**rouped into
8+
> **M**eaningful
9+
> **O**ptions and
10+
> **J**oined
11+
> **O**bjects
12+
513
## Overview
614

715
ArgMojo provides a builder-pattern API for defining and parsing command-line arguments in Mojo. It supports:
@@ -87,6 +95,8 @@ fn main() raises:
8795

8896
## Usage Examples
8997

98+
For detailed explanations and more examples of every feature, see the **[User Manual](docs/user_manual.md)**.
99+
90100
Build the demo binary first, then try the examples below:
91101

92102
```bash
@@ -197,6 +207,7 @@ pixi run clean
197207
```txt
198208
argmojo/
199209
├── docs/ # Documentation
210+
│ ├── user_manual.md # User manual with detailed examples
200211
│ └── argmojo_overall_planning.md
201212
├── src/
202213
│ └── argmojo/ # Main package

docs/argmojo_overall_planning.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,21 +206,21 @@ pattern # By order of add_arg() calls
206206
- [x] **`count` action**`-vvv``get_count("verbose") == 3` (argparse `-v` counting)
207207
- [x] **Clean exit for --help/--version** — use `sys.exit(0)` instead of `raise Error`
208208

209-
### Phase 3: Relationships & Validation (Next)
209+
### Phase 3: Relationships & Validation (for v0.1)
210210

211211
- [x] **Mutually exclusive flags**`cmd.mutually_exclusive(["json", "yaml", "toml"])`
212212
- [ ] **Flags required together**`cmd.required_together(["username", "password"])`
213213
- [ ] **`--no-X` negation**`--color` / `--no-color` paired flags (argparse BooleanOptionalAction)
214214
- [ ] **Aliases** for long names — `.aliases(["colour"])` for `--color`
215215
- [ ] **Deprecated arguments**`.deprecated("Use --format instead")` prints warning (argparse 3.13)
216216

217-
### Phase 4: Subcommands
217+
### Phase 4: Subcommands (maybe for v0.2)
218218

219219
- [ ] **Subcommand support**`app <subcommand> [args]` (cobra, argparse, clap)
220220
- [ ] **Subcommand help**`app help <subcommand>` or `app <subcommand> --help`
221221
- [ ] **Global vs local flags** — flags that persist through to subcommands (cobra persistent flags)
222222

223-
### Phase 5: Polish (Nice to Have)
223+
### Phase 5: Polish (nice-to-have features, may not be implemented soon)
224224

225225
- [ ] **Typo suggestions** — "Unknown option '--vrb', did you mean '--verbose'?" (Levenshtein distance; cobra, argparse 3.14)
226226
- [ ] **Colored error output** — using mist library for ANSI styled errors/help
@@ -229,7 +229,7 @@ pattern # By order of add_arg() calls
229229

230230
### Explicitly Out of Scope
231231

232-
These will **not** be implemented:
232+
These will **NOT** be implemented:
233233

234234
- Derive/decorator-based API (no macros in Mojo)
235235
- Shell completion script generation

0 commit comments

Comments
 (0)