Explain how to quickly depend on zig-args from other projects

This commit is contained in:
Antoine 2024-08-21 23:24:00 +02:00 committed by Felix Queißner
parent 03af1b6c5b
commit c5f79a133c

View file

@ -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