mirror of
https://github.com/MasterQ32/zig-args.git
synced 2024-09-16 20:24:03 +02:00
Explain how to quickly depend on zig-args from other projects
This commit is contained in:
parent
03af1b6c5b
commit
c5f79a133c
1 changed files with 17 additions and 0 deletions
17
README.md
17
README.md
|
@ -17,6 +17,23 @@ Simple-to-use argument parser with struct-based config
|
|||
- Strings
|
||||
- Enumerations
|
||||
|
||||
## Use in your project
|
||||
|
||||
Add the dependency in your `build.zig.zon` by running the following command:
|
||||
```bash
|
||||
zig fetch --save=args git+https://github.com/ikskuh/zig-args#master
|
||||
```
|
||||
|
||||
Add it to your exe in `build.zig`:
|
||||
```zig
|
||||
exe.root_module.addImport("args", b.dependency("args", .{ .target = target, .optimize = optimize }).module("args"));
|
||||
```
|
||||
|
||||
Then you can import it from your code:
|
||||
```zig
|
||||
const argsParser = @import("args");
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```zig
|
||||
|
|
Loading…
Reference in a new issue