diff options
| author | 2018-06-08 10:41:37 +0200 | |
|---|---|---|
| committer | 2018-06-08 10:41:37 +0200 | |
| commit | 765c82671a733991c46f3d3e14297bc94d6b56c3 (patch) | |
| tree | 77d5db9a7bf5f5e96ec4b84024aeeda5061acf5a /examples | |
| parent | Reworked extended.zig again! (diff) | |
| download | zig-clap-765c82671a733991c46f3d3e14297bc94d6b56c3.tar.gz zig-clap-765c82671a733991c46f3d3e14297bc94d6b56c3.tar.xz zig-clap-765c82671a733991c46f3d3e14297bc94d6b56c3.zip | |
Updated to newest pointer syntax
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/core.zig | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/core.zig b/examples/core.zig index eb512ef..4335ff2 100644 --- a/examples/core.zig +++ b/examples/core.zig | |||
| @@ -10,7 +10,7 @@ const Param = clap.Param; | |||
| 10 | const ArgError = clap.OsArgIterator.Error; | 10 | const ArgError = clap.OsArgIterator.Error; |
| 11 | 11 | ||
| 12 | // TODO: More specific error in this func type. | 12 | // TODO: More specific error in this func type. |
| 13 | const Command = fn(&mem.Allocator, &clap.ArgIterator(ArgError)) error!void; | 13 | const Command = fn(*mem.Allocator, *clap.ArgIterator(ArgError)) error!void; |
| 14 | 14 | ||
| 15 | const params = []Param(Command){ | 15 | const params = []Param(Command){ |
| 16 | Param(Command).init(help, false, Names.prefix("help")), | 16 | Param(Command).init(help, false, Names.prefix("help")), |
| @@ -74,7 +74,7 @@ pub fn main() !void { | |||
| 74 | try arg.param.id(allocator, parser.iter); | 74 | try arg.param.id(allocator, parser.iter); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | pub fn help(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 77 | pub fn help(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 78 | // debug.warn(usage); TODO: error: evaluation exceeded 1000 backwards branches | 78 | // debug.warn(usage); TODO: error: evaluation exceeded 1000 backwards branches |
| 79 | } | 79 | } |
| 80 | 80 | ||
| @@ -147,7 +147,7 @@ const missing_build_file = | |||
| 147 | \\ | 147 | \\ |
| 148 | ; | 148 | ; |
| 149 | 149 | ||
| 150 | fn cmdBuild(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) !void { | 150 | fn cmdBuild(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) !void { |
| 151 | var init = false; | 151 | var init = false; |
| 152 | var build_file: []const u8 = "build.zig"; | 152 | var build_file: []const u8 = "build.zig"; |
| 153 | var cache_dir: []const u8 = "zig-cache"; | 153 | var cache_dir: []const u8 = "zig-cache"; |
| @@ -323,17 +323,17 @@ const build_generic_usage = | |||
| 323 | ; | 323 | ; |
| 324 | 324 | ||
| 325 | 325 | ||
| 326 | fn cmdBuildExe(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 326 | fn cmdBuildExe(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 327 | } | 327 | } |
| 328 | 328 | ||
| 329 | // cmd:build-lib /////////////////////////////////////////////////////////////////////////////////// | 329 | // cmd:build-lib /////////////////////////////////////////////////////////////////////////////////// |
| 330 | 330 | ||
| 331 | fn cmdBuildLib(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 331 | fn cmdBuildLib(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | // cmd:build-obj /////////////////////////////////////////////////////////////////////////////////// | 334 | // cmd:build-obj /////////////////////////////////////////////////////////////////////////////////// |
| 335 | 335 | ||
| 336 | fn cmdBuildObj(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 336 | fn cmdBuildObj(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | // cmd:fmt ///////////////////////////////////////////////////////////////////////////////////////// | 339 | // cmd:fmt ///////////////////////////////////////////////////////////////////////////////////////// |
| @@ -350,17 +350,17 @@ const usage_fmt = | |||
| 350 | \\ | 350 | \\ |
| 351 | ; | 351 | ; |
| 352 | 352 | ||
| 353 | fn cmdFmt(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 353 | fn cmdFmt(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 354 | } | 354 | } |
| 355 | 355 | ||
| 356 | // cmd:targets ///////////////////////////////////////////////////////////////////////////////////// | 356 | // cmd:targets ///////////////////////////////////////////////////////////////////////////////////// |
| 357 | 357 | ||
| 358 | fn cmdTargets(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 358 | fn cmdTargets(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 359 | } | 359 | } |
| 360 | 360 | ||
| 361 | // cmd:version ///////////////////////////////////////////////////////////////////////////////////// | 361 | // cmd:version ///////////////////////////////////////////////////////////////////////////////////// |
| 362 | 362 | ||
| 363 | fn cmdVersion(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 363 | fn cmdVersion(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 364 | } | 364 | } |
| 365 | 365 | ||
| 366 | // cmd:test //////////////////////////////////////////////////////////////////////////////////////// | 366 | // cmd:test //////////////////////////////////////////////////////////////////////////////////////// |
| @@ -374,7 +374,7 @@ const usage_test = | |||
| 374 | \\ | 374 | \\ |
| 375 | ; | 375 | ; |
| 376 | 376 | ||
| 377 | fn cmdTest(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 377 | fn cmdTest(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | // cmd:run ///////////////////////////////////////////////////////////////////////////////////////// | 380 | // cmd:run ///////////////////////////////////////////////////////////////////////////////////////// |
| @@ -390,7 +390,7 @@ const usage_run = | |||
| 390 | \\ | 390 | \\ |
| 391 | ; | 391 | ; |
| 392 | 392 | ||
| 393 | fn cmdRun(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 393 | fn cmdRun(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | // cmd:translate-c ///////////////////////////////////////////////////////////////////////////////// | 396 | // cmd:translate-c ///////////////////////////////////////////////////////////////////////////////// |
| @@ -428,7 +428,7 @@ const info_zen = | |||
| 428 | \\ | 428 | \\ |
| 429 | ; | 429 | ; |
| 430 | 430 | ||
| 431 | fn cmdZen(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 431 | fn cmdZen(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 432 | } | 432 | } |
| 433 | 433 | ||
| 434 | // cmd:internal //////////////////////////////////////////////////////////////////////////////////// | 434 | // cmd:internal //////////////////////////////////////////////////////////////////////////////////// |
| @@ -442,5 +442,5 @@ const usage_internal = | |||
| 442 | \\ | 442 | \\ |
| 443 | ; | 443 | ; |
| 444 | 444 | ||
| 445 | fn cmdInternal(allocator: &mem.Allocator, args: &clap.ArgIterator(ArgError)) (error{}!void) { | 445 | fn cmdInternal(allocator: *mem.Allocator, args: *clap.ArgIterator(ArgError)) (error{}!void) { |
| 446 | } | 446 | } |