Commit graph

65 commits

Author SHA1 Message Date
Linus Groh
0abdd6947a Update std.builtin.Type field names
See: https://github.com/ziglang/zig/pull/21225
2024-08-30 08:22:56 +02:00
Bob Farrell
03af1b6c5b Fix deprecation error
Fixes:

```
zig-linux-x86_64-0.14.0-dev.61+04e08ea88/lib/std/mem.zig:2286:19: error: deprecated; use splitSequence, splitAny, or splitScalar
```
2024-06-18 20:58:58 +02:00
Sean
8ea0d56a45 Update args.zig
This version of `parseBool` should be pretty independant of the Zig version
2024-04-26 18:46:56 +02:00
Sean
30fc83d347 Optimize parseBool
Instead of repeatedly calling `std.mem.eql`, this would make a single call to `ComptimeStringMap.get`
2024-04-26 18:46:56 +02:00
Bob Farrell
01d72b9a01 Add support for wrapping help output
If `wrap_len` is provided, wrap lines over `wrap_len` characters,
retaining indentation.

Fix test runner - tests were not running with `zig build test`.
2024-03-20 10:53:37 +01:00
Linus Groh
89f18a104d Replace std.mem.copy() with @memcpy()
See: https://github.com/ziglang/zig/pull/18143
2024-01-05 18:05:13 +01:00
Linus Groh
9cf8d73bdc Run zig fmt 2024-01-05 18:05:13 +01:00
rimuspp
3797c1473b Changed to fix local variable is never mutated 2023-11-21 10:29:43 +01:00
Linus Groh
7989929d05 Rename meta.{summary => usage_summary} 2023-08-31 23:09:53 +02:00
Linus Groh
d30fe3f002 Prefix first line in help output with 'Usage:'
This is much more common than directly starting with the name, some
examples from popular CLIs:

- "Usage: zig [command] [options]"
- "Usage: node [options] [ script.js ] [arguments]"
- "usage: python3 [option] ... [-c cmd | -m mod | file | -] [arg] ..."
- "usage: git [-v | --version] [-h | --help] [...]"
- "Usage: vim [arguments] [file ..]"
2023-08-31 23:09:53 +02:00
jnagpaul
2cae03af05 move name to print argument 2023-07-27 01:58:15 +02:00
jnagpaul
c41c9b03e9 move cli help name to meta 2023-07-27 01:58:15 +02:00
jnagpaul
e93e9cb722 Add printHelp to demo.zig and add printHelp tests 2023-07-27 01:58:15 +02:00
jnagpaul
9270d43252 Add unit testing 2023-07-27 01:58:15 +02:00
jnagpaul
47ddf1db4d Fix line breaks 2023-07-27 01:58:15 +02:00
jnagpaul
188f0ec684 Add help helper 2023-07-27 01:58:15 +02:00
Linus Groh
91d1e89fb8 Update builtins to infer target type
See: https://github.com/ziglang/zig/pull/16163
2023-06-28 21:06:17 +02:00
Felix "xq" Queißner
53f9b53d7b Makes error_handling comptime known 2023-05-28 11:46:46 +02:00
dweiller
e0fd4e607a Update for multi-for loops 2023-02-23 08:27:44 +01:00
Hein Thant
8dca20383c make error kind enum public 2023-02-13 07:22:20 +01:00
Felix "xq" Queißner
77a2c6557b Update to 0.11.0-dev.900+0fb53bd24 2022-12-21 11:20:53 +01:00
Lee Cannon
faac0e1880 update for zig master 2022-12-02 08:24:43 +01:00
Felix "xq" Queißner
69c2d5b75a Fixes stupid UB bug. 2022-10-22 12:50:18 +02:00
Lee Cannon
51a3a82712 update for zig master 2022-09-18 20:21:49 +02:00
Lee Cannon
e053c11ceb support verbs with void and zero sized payload types 2022-08-15 14:57:06 +02:00
Aaron Sikes
1ff417ac1f Add index of "--", to differentiate positional args before/after 2022-03-11 17:47:53 +01:00
Anthon van der Neut
abf9a9ec6a document verb in readme
Show in demo_verb.zig that you can have non-verb options and verb specific options.
Test that a non-verb option can come before verb.
2022-02-10 11:03:49 +01:00
Anthon van der Neut
fa0aa0fd78 fix -- to cause error.MissingArgument
<<< folded to d687d791da9b
2022-02-08 13:09:25 +01:00
ominitay
da1cbd424f Fix the fix for the fix ... 2022-02-05 18:10:44 +01:00
ominitay
2419d85069 Fixed the fix :^) 2022-02-05 18:10:44 +01:00
Vincent Rischmann
58211a7398 modify TestIterator for new args iterator signature 2022-02-05 08:47:38 +01:00
Vincent Rischmann
6d557ddfe2 update args iterator usage for latest zig 2022-02-05 08:47:38 +01:00
Felix "xq" Queißner
dfa132adcb Fixes tests. 2021-12-23 09:32:49 +01:00
Felix "xq" Queißner
b7b3e98d98 Update to latest master. 2021-12-23 09:17:24 +01:00
Vincent Rischmann
72a79c87fd update allocator usage for latest zig 2021-12-06 09:08:30 +01:00
Vincent Rischmann
689a5a0ee6 allow using a slice with a sentinel 2021-10-11 10:11:35 +02:00
Felix "xq" Queißner
11f976877c Fixes minor bug. 2021-09-15 08:58:14 +02:00
Felix "xq" Queißner
2523ff127f Fixes two minor bugs. 2021-08-27 23:47:45 +02:00
Felix "xq" Queißner
edaeb0fbaf Adds support for shorthands for options. 2021-08-27 20:16:19 +02:00
Felix "xq" Queißner
44e6912d88 Adds verb parsing for long-options. 2021-08-27 19:03:26 +02:00
Felix "xq" Queißner
8b970a13dd Adds verbless parsing test. 2021-08-27 18:21:59 +02:00
Felix "xq" Queißner
223f387efe First step towards integrated verb parsing. 2021-08-27 17:03:13 +02:00
Felix (xq) Queißner
8d4e800fd2 Makes positionals and exe name NUL terminated. 2021-08-11 13:10:50 +02:00
Felix (xq) Queißner
40e31873fc Exports Options from ParseResult, adds ZPM file. 2021-07-14 09:00:53 +02:00
Felix (xq) Queißner
139c759a30 Update to latest master. 2021-06-25 23:28:50 +02:00
Felix (xq) Queißner
bdc8af650c BREAKING: Implements proper configurable error reporting and improved error messages. 2021-05-12 10:24:50 +02:00
guillaumederex
97bf199a89 Useless line 2021-01-23 12:15:25 +01:00
guillaumederex
2ad82cadb4 Added test for parseInt 2021-01-23 12:15:25 +01:00
guillaumederex
7530869efc Implemented #11 2021-01-23 12:15:25 +01:00
guillaumederex
b5fb1a8850 Fixed error prints 2021-01-17 19:38:19 +01:00