diff options
| author | 2024-10-22 17:46:47 +0200 | |
|---|---|---|
| committer | 2024-10-22 17:48:34 +0200 | |
| commit | e73b56aa4bcb7e53144ef96ee978f2a19b32669d (patch) | |
| tree | 0ab5e3d426e25d2ad9d2e0cd0015fc010d9ea182 /clap/args.zig | |
| parent | feat: Add `terminating_positional` to `clap.ParseOptions` (diff) | |
| download | zig-clap-e73b56aa4bcb7e53144ef96ee978f2a19b32669d.tar.gz zig-clap-e73b56aa4bcb7e53144ef96ee978f2a19b32669d.tar.xz zig-clap-e73b56aa4bcb7e53144ef96ee978f2a19b32669d.zip | |
refactor: Always access using full namespace
This is my new preferred style of programming Zig :)
Diffstat (limited to 'clap/args.zig')
| -rw-r--r-- | clap/args.zig | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/clap/args.zig b/clap/args.zig index d0aaee3..6a424e3 100644 --- a/clap/args.zig +++ b/clap/args.zig | |||
| @@ -1,12 +1,3 @@ | |||
| 1 | const builtin = @import("builtin"); | ||
| 2 | const std = @import("std"); | ||
| 3 | |||
| 4 | const debug = std.debug; | ||
| 5 | const heap = std.heap; | ||
| 6 | const mem = std.mem; | ||
| 7 | const process = std.process; | ||
| 8 | const testing = std.testing; | ||
| 9 | |||
| 10 | /// An example of what methods should be implemented on an arg iterator. | 1 | /// An example of what methods should be implemented on an arg iterator. |
| 11 | pub const ExampleArgIterator = struct { | 2 | pub const ExampleArgIterator = struct { |
| 12 | pub fn next(iter: *ExampleArgIterator) ?[]const u8 { | 3 | pub fn next(iter: *ExampleArgIterator) ?[]const u8 { |
| @@ -35,7 +26,9 @@ test "SliceIterator" { | |||
| 35 | var iter = SliceIterator{ .args = &args }; | 26 | var iter = SliceIterator{ .args = &args }; |
| 36 | 27 | ||
| 37 | for (args) |a| | 28 | for (args) |a| |
| 38 | try testing.expectEqualStrings(a, iter.next().?); | 29 | try std.testing.expectEqualStrings(a, iter.next().?); |
| 39 | 30 | ||
| 40 | try testing.expectEqual(@as(?[]const u8, null), iter.next()); | 31 | try std.testing.expectEqual(@as(?[]const u8, null), iter.next()); |
| 41 | } | 32 | } |
| 33 | |||
| 34 | const std = @import("std"); | ||