github Hejsil/zig-clap v0.4.0
0.4.0

latest releases: 0.9.1, 0.9.0, 0.8.0...
3 years ago

zig-clap release 0.4.0 which compiles and works for zig 0.8.0.

Changes

Breaking

  • Arguments after -- will now all be treated like positional arguments, even if they match something else.
    • -a -b gives you the flags a and b
    • -a -- -b gives you the flag a and the positional argument -b.
    • This applies to both clap.StreamingClap and clap.parse.
  • clap.parse and clap.parseEx now takes a ParserOptions
    • This removes the allocator and diag arguments from these functions and moves them into this new struct.
    • This change has been made to make it possible to introduce more options to these functions in the future without breaking the API again.
  • clap.StreamingClap.next no longer takes the diag argument.
    • Instead, a diagnostic field have been added to this parser.
  • All enums have had their members names changed to snake_case.

New

  • Added new args.ShellIterator (this might actually have been in 0.3.0 but it wasn't in the release notes 🤷)
    • This iterator takes a single string and splits it into arguments similarly to how sh or bash would.
    • See the tests to get an idea as to how this iterator splits arguments.
  • You should now be able to install zig-clap through both gyro and zigmod package managers.
    • zig-clap can also be found on the astrolab package repository.

Don't miss a new zig-clap release

NewReleases is sending notifications on new releases.