summaryrefslogtreecommitdiff
path: root/clap.zig (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fix: More than 2 positionals not parsing correctlyGravatar Jimmi Holst Christensen2025-02-211-26/+44
| | | | Fixes #149
* chore: update to zig version 0.14.0-dev.2837+f38d7a92cGravatar Travis Staloch2025-01-191-2/+2
|
* chore: Update to latest version of zigGravatar Jimmi Holst Christensen2024-11-041-9/+38
|
* feat: Support multiple positionals of different typesGravatar Jimmi Holst Christensen2024-10-241-68/+182
|
* refactor: positonals type now depend on the number of values takenGravatar Jimmi Holst Christensen2024-10-221-35/+94
| | | | | | For `Values.one` positionals will be of type `?T` For `Values.many` positonals will be of type `[]const T`
* refactor: Always access using full namespaceGravatar Jimmi Holst Christensen2024-10-221-95/+88
| | | | This is my new preferred style of programming Zig :)
* feat: Add `terminating_positional` to `clap.ParseOptions`Gravatar Jimmi Holst Christensen2024-10-221-3/+49
| | | | | | | | This option makes `clap.parse` and `clap.parseEx` stop parsing after encountering a certain positional index. Setting `terminating_positional` to 0 will make them stop parsing after the 0th positional has been added to `positionals` (aka after parsing 1 positional)
* chore: Correct eval branch quota comment in `countParams`Gravatar Jimmi Holst Christensen2024-10-221-2/+2
|
* refactor: Remove workaround in `parseEx` that required `anyerror`Gravatar Jimmi Holst Christensen2024-10-221-47/+22
|
* adapt to latest zig changesGravatar owl2024-08-301-3/+3
|
* count codepoints instead of bytes, to determine widthGravatar owl2024-08-301-16/+60
| | | | | | | | | | | A complete solution would be to count grapheme clusters, but that would require adding a dependency on something like zg. Counting codepoints will ensure that typical non-ASCII text is supported, but you can still throw it off with more complex Unicode constructions, which might not be so useful in help text. Fixes #75
* feat: Allow for the assignment separator to be configuredGravatar Jimmi Holst Christensen2024-07-181-0/+23
|
* Update to latest zig0.9.0Gravatar Techatrix2024-06-161-4/+4
| | | | | | See https://github.com/ziglang/zig/pull/19847 Compatibility with Zig 0.13.0 remains unchanged
* Arguments: Ensure no member of `fields` is undefinedGravatar Jimmi Holst Christensen2024-03-301-2/+9
| | | | related #122
* Updated to latest zigGravatar Benoit Giannangeli2024-03-121-1/+1
|
* Update to latest version of zigGravatar Jimmi Holst Christensen2024-01-091-2/+2
|
* Remove the default allocator from `ParseOptions`Gravatar Jimmi Holst Christensen2023-12-131-6/+1
| | | | fixes #111
* Fix short only params not getting fields in `Arguments`Gravatar Jimmi Holst Christensen2023-11-161-10/+11
| | | | fixes #84
* Update to latest zigGravatar Jimmi Holst Christensen2023-06-271-12/+12
|
* Update to latest zigGravatar Jimmi Holst Christensen2023-06-221-2/+2
|
* Update to latest version of zigGravatar Jimmi Holst Christensen2023-06-181-1/+1
|
* help,usage: Support multiple positionals (#97)Gravatar Andreas Herrmann2023-06-151-16/+43
|
* Count occurrences of flags (was "Add .count type for flags") (#96)Gravatar Devin J. Pohly2023-04-021-5/+21
| | | | | | | | | | | | Breaking change: parseEx now counts the number of occurrences of flag parameters (those with takes_value == .none) and returns the count as a u8. Users of the library will need to change if (arg_result.my_flag) to if (arg_result.my_flag != 0)
* chore: update to latest masterGravatar Rekai Musuka2023-02-221-2/+2
| | | | update to follow latest for loop syntax
* Fix misspelled thingsGravatar Jimmi Holst Christensen2023-01-121-9/+9
|
* Update to latest Zig masterGravatar Jakub Konka2022-12-201-4/+4
| | | | Rename `builtin.Struct.field_type` to `builtin.Struct.type`.
* Handle change to std.ArrayList(T).toOwnedSlice()Gravatar Rekai Musuka2022-12-011-3/+3
| | | | toOwnedSlice() now returns an error union
* Workaround stage2 bugGravatar Jimmi Holst Christensen2022-11-221-1/+3
|
* Fix regression from last commitGravatar Jimmi Holst Christensen2022-10-031-11/+14
|
* Add function for getting the prefix of a param nameGravatar Jimmi Holst Christensen2022-10-031-15/+19
|
* use builtin.Type instead of deprecated builtin.TypeInfoGravatar Jakub Konka2022-09-181-1/+1
| | | | Syncs with latest zig master version 0.10.0-dev.4117+54854e2ab
* Fix zig-clap for new default compilerGravatar Jimmi Holst Christensen2022-08-251-37/+50
| | | | | Also enable test suit for both stage 1 and stage 2, to ensure we don't break things for people who haven't switched yet.
* Have all tests have a nameGravatar Jimmi Holst Christensen2022-07-281-1/+1
| | | | fixes #79
* Print multi value positionals correctly in `usage`Gravatar Jimmi Holst Christensen2022-04-281-0/+6
|
* New `help` api that provides options as to how paramters are printed.Gravatar Jimmi Holst Christensen2022-03-301-92/+686
| | | | fixes \#28
* Fix long param parsing with '-' and '\_' in nameGravatar Jimmi Holst Christensen2022-03-241-2/+6
|
* Add parseParams and friendsGravatar Jimmi Holst Christensen2022-03-231-341/+389
|
* Refactor parseParam into a state machineGravatar Jimmi Holst Christensen2022-03-231-64/+279
| | | | | | This new parser stops when it hits something that looks like a new parameter. This is the precurser to parsing multiple parameters in a single function.
* Workaround infinit loop caused by `try` inside `inline for`Gravatar Jimmi Holst Christensen2022-03-211-19/+59
| | | | fixes #72
* Allow for clap to parse argument values into typesGravatar Jimmi Holst Christensen2022-03-091-181/+365
| | | | | | | | | | | | | | This changes - `.flag`, `.option`, `.options` and `.positionals` are now just fields you access on the result of `parse` and `parseEx`. - `clap.ComptimeClap` has been removed. - `clap.StreamingClap` is now called `clap.streaming.Clap` - `parse` and `parseEx` now takes a `value_parsers` argument that provides the parsers to parse values. - Remove `helpEx`, `helpFull`, `usageEx` and `usageFull`. They now just expect `Id` to have methods for getting the description and value texts.
* Revert "Change clap into generating a struct"Gravatar Jimmi Holst Christensen2022-02-251-48/+217
| | | | This reverts commit cfaac64c404fb1c2e892880410aa3b7dd881ea58.
* Change clap into generating a structGravatar Jimmi Holst Christensen2022-02-251-217/+48
| | | | | | | | | This changes - `.flag`, `.option`, `.options` and `.positionals` are now just fields you access. - Move the current `clap.parse` and friends into `clap.untyped.parse` - This is in preperation for `clap.typed.parse`
* Refactor the ArgIterator interfaceGravatar Jimmi Holst Christensen2022-01-311-4/+10
| | | | | | | | | They now follow the interface provided by the standard library. This now means that we no longer needs `args.OsIterator` as that the one from `std` can now be used directly. Also remove `args.ShellIterator` as a simular iterator exists in `std` called `ArgIteratorGeneral`.
* Avoid using the print APIGravatar Jimmi Holst Christensen2022-01-051-23/+37
| | | | | | The current Zig print API is quite good at slowing down compilation and producing binary bloat. This commit makes an attempt to avoid using it when not nessesary.
* zig master updates: allocator changes (#60)Gravatar Asherah Connor2021-12-061-2/+2
|
* Update mem.split call for latest zig masterGravatar Ryan Liptak2021-09-061-1/+1
|
* Merge branch 'master' into zig-masterGravatar Komari Spaghetti2021-09-051-1/+14
|\
| * Indent help text on every new line to allow for user-controlled wrappingGravatar Ryan Liptak2021-09-051-1/+14
| |
| * Fix all new compiler errors from zig masterGravatar Komari Spaghetti2021-06-241-1/+1
| |
* | Update calls to tokenizerGravatar Stephen Gregoratto2021-08-111-1/+1
| | | | | | | | | | The tokenize function was made generic, so we have to pass the type as the first parameter.