diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2021-02-07 19:11:54 +0100 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2021-02-07 19:17:31 +0100 |
| commit | a8a70a3b048199bd74f37c79d5b8460194fa0789 (patch) | |
| tree | edd38306c6f61e2fba9593e2a57574a3cf267b32 /riverctl/args.zig | |
| parent | 96d460c477635925b77c9cfd27528009914dadbc (diff) | |
| download | river-a8a70a3b048199bd74f37c79d5b8460194fa0789.tar.gz river-a8a70a3b048199bd74f37c79d5b8460194fa0789.tar.xz | |
riverctl: add -focused-output for option commands
This is more convenient for interactive usage and makes using the same
bindings across multiple outputs easy.
Diffstat (limited to 'riverctl/args.zig')
| -rw-r--r-- | riverctl/args.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/riverctl/args.zig b/riverctl/args.zig index 3240a97..29ca0f9 100644 --- a/riverctl/args.zig +++ b/riverctl/args.zig @@ -60,6 +60,7 @@ pub fn Args(comptime num_positionals: comptime_int, comptime flag_defs: []const var arg_idx: usize = 0; var positional_idx: usize = 0; outer: while (arg_idx < argv.len) : (arg_idx += 1) { + var should_continue = false; inline for (flag_defs) |flag_def, flag_idx| { if (cstr.cmp(flag_def.name, argv[arg_idx]) == 0) { switch (flag_def.kind) { @@ -73,9 +74,12 @@ pub fn Args(comptime num_positionals: comptime_int, comptime flag_defs: []const "' requires an argument but none was provided!", .{}); }, } - continue :outer; + // TODO: this variable exists as a workaround for the fact that + // using continue :outer here crashes the stage1 compiler. + should_continue = true; } } + if (should_continue) continue; if (positional_idx == num_positionals) { root.printErrorExit( |
