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
This PR prepares the repository for the v0.4.0 release by updating
documentation/release notes, aligning stringification with Mojo’s
`Writable` conventions, and refreshing the pixi workspace
configuration/lockfiles.
**Changes:**
- Remove `__str__` implementations from core structs and rely on
`write_to` (`Writable`) for string representations.
- Update docs (user manual, changelog, README, planning doc) for Mojo
v0.26.2+/v0.4.0 release content.
- Bump pixi workspace version and refresh pixi tasks/lockfile to reflect
the new environment.
-**Remainder positional**: `.remainder()` consumes all remaining tokens
78
+
-**Allow hyphen values**: `.allow_hyphen_values()` accepts `-` as a regular value (stdin convention)
79
+
-**Partial parsing**: `parse_known_arguments()` collects unrecognised options instead of erroring
80
+
-**Compile-time validation**: builder parameters validated at `mojo build` time via `comptime assert`
81
+
-**Registration-time validation**: group constraint typos caught when the program starts, not when the user runs it
56
82
57
83
---
58
84
@@ -62,6 +88,8 @@ My goal is to provide a Mojo-idiomatic argument parsing library that can be easi
62
88
63
89
## Installation
64
90
91
+
### Package Manager
92
+
65
93
ArgMojo is available in the modular-community `https://repo.prefix.dev/modular-community` package repository. To access this repository, add it to your `channels` list in your `pixi.toml` file:
66
94
67
95
```toml
@@ -75,17 +103,14 @@ Then, you can install ArgMojo using any of these methods:
75
103
1. In the `mojoproject.toml` file of your project, add the following dependency:
76
104
77
105
```toml
78
-
argmojo = "==0.3.0"
106
+
argmojo = "*"
79
107
```
80
108
81
109
Then run `pixi install` to download and install the package.
82
110
83
-
The following table summarizes the package versions and their corresponding Mojo versions:
111
+
### Using mojopkg
84
112
85
-
| `argmojo` version | `mojo` version | package manager |
The package manager may not be up to date with the latest ArgMojo release. If you want to use the latest version, you can download the `mojopkg` file from the [latest release](https://github.com/forfudan/argmojo/releases) and include it in your project directory.
89
114
90
115
## Quick Start
91
116
@@ -95,7 +120,7 @@ Here is a simple example of how to use ArgMojo in a Mojo program. See `examples/
95
120
from argmojo import Argument, Command
96
121
97
122
98
-
fn main() raises:
123
+
def main() raises:
99
124
var app = Command("mgrep", "Search for PATTERN in each FILE.", version="1.0.0")
100
125
101
126
# Positional arguments
@@ -144,10 +169,12 @@ For detailed explanations and more examples of every feature, see the **[User Ma
Copy file name to clipboardExpand all lines: docs/argmojo_overall_planning.md
+14-28Lines changed: 14 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ At the moment, Mojo does not have a mature command-line argument parsing library
10
10
11
11
## 2. Cross-Language Research Summary
12
12
13
-
This section summarises the key design patterns and features from well-known arg parsers across multiple languages. The goal is to extract **universally useful ideas** that are feasible in Mojo 0.26.1, and to exclude features that depend on language-specific capabilities (macros, decorators, reflection, closures-as-first-class) that Mojo does not yet provide.
13
+
This section summarises the key design patterns and features from well-known arg parsers across multiple languages. The goal is to extract **universally useful ideas** that are feasible in Mojo 0.26.2, and to exclude features that depend on language-specific capabilities (macros, decorators, reflection, closures-as-first-class) that Mojo does not yet provide.
14
14
15
15
### 2.1 Libraries Surveyed
16
16
@@ -55,7 +55,7 @@ These features appear across multiple libraries and depend only on string operat
0 commit comments