summaryrefslogtreecommitdiff
path: root/clap.zig (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-10-24feat: Support multiple positionals of different typesGravatar Jimmi Holst Christensen1-68/+182
2024-10-22refactor: positonals type now depend on the number of values takenGravatar Jimmi Holst Christensen1-35/+94
For `Values.one` positionals will be of type `?T` For `Values.many` positonals will be of type `[]const T`
2024-10-22refactor: Always access using full namespaceGravatar Jimmi Holst Christensen1-95/+88
This is my new preferred style of programming Zig :)
2024-10-22feat: Add `terminating_positional` to `clap.ParseOptions`Gravatar Jimmi Holst Christensen1-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)
2024-10-22chore: Correct eval branch quota comment in `countParams`Gravatar Jimmi Holst Christensen1-2/+2
2024-10-22refactor: Remove workaround in `parseEx` that required `anyerror`Gravatar Jimmi Holst Christensen1-47/+22
2024-08-30adapt to latest zig changesGravatar owl1-3/+3
2024-08-30count codepoints instead of bytes, to determine widthGravatar owl1-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
2024-07-18feat: Allow for the assignment separator to be configuredGravatar Jimmi Holst Christensen1-0/+23
2024-06-16Update to latest zig0.9.0Gravatar Techatrix1-4/+4
See https://github.com/ziglang/zig/pull/19847 Compatibility with Zig 0.13.0 remains unchanged
2024-03-30Arguments: Ensure no member of `fields` is undefinedGravatar Jimmi Holst Christensen1-2/+9
related #122
2024-03-12Updated to latest zigGravatar Benoit Giannangeli1-1/+1
2024-01-09Update to latest version of zigGravatar Jimmi Holst Christensen1-2/+2
2023-12-13Remove the default allocator from `ParseOptions`Gravatar Jimmi Holst Christensen1-6/+1
fixes #111
2023-11-16Fix short only params not getting fields in `Arguments`Gravatar Jimmi Holst Christensen1-10/+11
fixes #84
2023-06-27Update to latest zigGravatar Jimmi Holst Christensen1-12/+12
2023-06-22Update to latest zigGravatar Jimmi Holst Christensen1-2/+2
2023-06-18Update to latest version of zigGravatar Jimmi Holst Christensen1-1/+1
2023-06-15help,usage: Support multiple positionals (#97)Gravatar Andreas Herrmann1-16/+43
2023-04-02Count occurrences of flags (was "Add .count type for flags") (#96)Gravatar Devin J. Pohly1-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)
2023-02-22chore: update to latest masterGravatar Rekai Musuka1-2/+2
update to follow latest for loop syntax
2023-01-12Fix misspelled thingsGravatar Jimmi Holst Christensen1-9/+9
2022-12-20Update to latest Zig masterGravatar Jakub Konka1-4/+4
Rename `builtin.Struct.field_type` to `builtin.Struct.type`.
2022-12-01Handle change to std.ArrayList(T).toOwnedSlice()Gravatar Rekai Musuka1-3/+3
toOwnedSlice() now returns an error union
2022-11-22Workaround stage2 bugGravatar Jimmi Holst Christensen1-1/+3
2022-10-03Fix regression from last commitGravatar Jimmi Holst Christensen1-11/+14
2022-10-03Add function for getting the prefix of a param nameGravatar Jimmi Holst Christensen1-15/+19
2022-09-18use builtin.Type instead of deprecated builtin.TypeInfoGravatar Jakub Konka1-1/+1
Syncs with latest zig master version 0.10.0-dev.4117+54854e2ab
2022-08-25Fix zig-clap for new default compilerGravatar Jimmi Holst Christensen1-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.
2022-07-28Have all tests have a nameGravatar Jimmi Holst Christensen1-1/+1
fixes #79
2022-04-28Print multi value positionals correctly in `usage`Gravatar Jimmi Holst Christensen1-0/+6
2022-03-30New `help` api that provides options as to how paramters are printed.Gravatar Jimmi Holst Christensen1-92/+686
fixes \#28
2022-03-24Fix long param parsing with '-' and '\_' in nameGravatar Jimmi Holst Christensen1-2/+6
2022-03-23Add parseParams and friendsGravatar Jimmi Holst Christensen1-341/+389
2022-03-23Refactor parseParam into a state machineGravatar Jimmi Holst Christensen1-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.
2022-03-21Workaround infinit loop caused by `try` inside `inline for`Gravatar Jimmi Holst Christensen1-19/+59
fixes #72
2022-03-09Allow for clap to parse argument values into typesGravatar Jimmi Holst Christensen1-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.
2022-02-25Revert "Change clap into generating a struct"Gravatar Jimmi Holst Christensen1-48/+217
This reverts commit cfaac64c404fb1c2e892880410aa3b7dd881ea58.
2022-02-25Change clap into generating a structGravatar Jimmi Holst Christensen1-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`
2022-01-31Refactor the ArgIterator interfaceGravatar Jimmi Holst Christensen1-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`.
2022-01-05Avoid using the print APIGravatar Jimmi Holst Christensen1-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.
2021-12-06zig master updates: allocator changes (#60)Gravatar Asherah Connor1-2/+2
2021-09-06Update mem.split call for latest zig masterGravatar Ryan Liptak1-1/+1
2021-09-05Indent help text on every new line to allow for user-controlled wrappingGravatar Ryan Liptak1-1/+14
2021-08-11Update calls to tokenizerGravatar Stephen Gregoratto1-1/+1
The tokenize function was made generic, so we have to pass the type as the first parameter.
2021-06-24Fix all new compiler errors from zig masterGravatar Komari Spaghetti1-1/+1
2021-06-24Fix all new compiler errors from zig masterGravatar Komari Spaghetti1-1/+1
2021-06-24Stay under 100 chars per line in all the codeGravatar Komari Spaghetti1-33/+87
2021-06-24parseParam: Set eval quota to std.math.maxInt(u32)Gravatar Komari Spaghetti1-0/+10
fixes #42 related #39
2021-06-24parse: Copy in arena after using it in parseExGravatar Komari Spaghetti1-11/+9
fixes #43