Commit Graph

13 Commits

Author SHA1 Message Date
Jimmi Holst Christensen
cf3a4e7638 Remove the default allocator from ParseOptions
fixes #111
2023-12-13 08:59:38 +01:00
Devin J. Pohly
ab69ef2db4
Count occurrences of flags (was "Add .count type for flags") (#96)
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-04-02 13:10:40 +02:00
Jimmi Holst Christensen
ac5f46541c Update help and usage examples 2022-03-30 22:04:15 +02:00
Jimmi Holst Christensen
5166a15378 Add parseParams and friends 2022-03-23 21:48:20 +01:00
Jimmi Holst Christensen
5f7b75d552 Allow for clap to parse argument values into types
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-03-09 18:12:40 +01:00
Jimmi Holst Christensen
c06c93608c Revert "Change clap into generating a struct"
This reverts commit cfaac64c40.
2022-02-25 19:44:52 +01:00
Jimmi Holst Christensen
cfaac64c40 Change clap into generating a struct
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-02-25 19:40:00 +01:00
Jimmi Holst Christensen
b2059e5d08 Improve help and usage examples
Instead of just calling these function, have the examples be small
programs that demonstrates how you would actually use them together with
argument parsing.

fixes #57
2021-11-29 17:09:26 +01:00
J.R. "hiljusti" Hill
f1c0a9fda6
Update example of usage (#45) 2021-07-06 09:00:25 +00:00
Komari Spaghetti
c7d83fcce1 Update to latest zig in preperation for 0.8.0 2021-05-26 21:06:10 +02:00
Komari Spaghetti
4c14bfd518 Modernize codebase
* Better naming for variables
* Follow naming style of enums
* Use `writer()` instead of `outStream()`
* Change many initializers to be a one liner
* Don't explicitly initialize fields to their default value
2021-05-08 18:08:52 +02:00
Jimmi Holst Christensen
0b1dd505dd Merge branch 'master' into zig-master 2020-04-18 16:43:18 +02:00
Jimmi Holst Christensen
cc056cf423 Add clap.usage 2020-03-05 23:24:36 +01:00