diff options
| author | 2018-09-15 13:14:34 +0200 | |
|---|---|---|
| committer | 2018-09-15 13:14:34 +0200 | |
| commit | 97ace8a3eb2381a4c48250110d0b73e067b0ff97 (patch) | |
| tree | f400add3a3dcbd59003cae0676679b574e6992a2 | |
| parent | Updated to newest @This builtin (diff) | |
| parent | Update .travis.yml (diff) | |
| download | zig-clap-97ace8a3eb2381a4c48250110d0b73e067b0ff97.tar.gz zig-clap-97ace8a3eb2381a4c48250110d0b73e067b0ff97.tar.xz zig-clap-97ace8a3eb2381a4c48250110d0b73e067b0ff97.zip | |
Merge branch 'master' of github.com:Hejsil/zig-clap
Diffstat (limited to '')
| -rw-r--r-- | .travis.yml | 1 | ||||
| -rw-r--r-- | README.md | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml index 740ce32..2253826 100644 --- a/.travis.yml +++ b/.travis.yml | |||
| @@ -9,3 +9,4 @@ git: | |||
| 9 | script: | 9 | script: |
| 10 | - zig-linux-*/zig version | 10 | - zig-linux-*/zig version |
| 11 | - zig-linux-*/zig test test.zig | 11 | - zig-linux-*/zig test test.zig |
| 12 | |||
| @@ -1,17 +1,17 @@ | |||
| 1 | # zig-clap | 1 | # zig-clap |
| 2 | 2 | ||
| 3 | An easy to use command line argument parser library for Zig. | 3 | A simple and easy to use command line argument parser library for Zig. |
| 4 | It's ment as a thin layer of abstraction over parsing arguments which allows | ||
| 5 | for further abstraction on top, such as filling in a `HashMap`. | ||
| 4 | 6 | ||
| 5 | ## Features | 7 | ## Features |
| 6 | 8 | ||
| 7 | See [example](example.zig). | 9 | See [example](https://github.com/Hejsil/zig-clap/blob/38a51948069f405864ab327826b5975a6d0c93a8/test.zig#L200-L247). |
| 8 | |||
| 9 | * Assosiate arguements with fields of a struct. | ||
| 10 | * When an arguement is found by the clap, the field is set to a parsed version of the value. | ||
| 11 | * `zig-clap` provides some default parses, but you can make your own as well. | ||
| 12 | * Short arguments `-a` | 10 | * Short arguments `-a` |
| 13 | * Chaining `-abc` where `a` and `b` does not take values. | 11 | * Chaining `-abc` where `a` and `b` does not take values. |
| 14 | * Long arguments `--long` | 12 | * Long arguments `--long` |
| 13 | * Bare arguments `bare` | ||
| 15 | * Supports both passing values using spacing and `=` (`-a 100`, `-a=100`) | 14 | * Supports both passing values using spacing and `=` (`-a 100`, `-a=100`) |
| 16 | * Short args also support passing values with no spacing or `=` (`-a100`) | 15 | * Short args also support passing values with no spacing or `=` (`-a100`) |
| 17 | * This all works with chaining (`-ba 100`, `-ba=100`, `-ba100`) | 16 | * This all works with chaining (`-ba 100`, `-ba=100`, `-ba100`) |
| 17 | |||