~novakane/rivercarro

5b0f495cae5b68ff8fba6808f677027f836eb400 — Hugo Machet 4 months ago a50cfe1
flags: Update to upstream latest commit

REF:
<https://github.com/riverwm/river/commit/c3370afa3d3b8d7756217e1d4df882a172f73c35>
2 files changed, 9 insertions(+), 7 deletions(-)

M src/flags.zig
M src/main.zig
M src/flags.zig => src/flags.zig +4 -2
@@ 63,9 63,11 @@ pub fn ParseResult(comptime flags: []const Flag) type {
            unreachable; // Invalid flag_name
        }

        pub fn argFlag(self: Self, flag_name: [*:0]const u8) ?[*:0]const u8 {
        pub fn argFlag(self: Self, flag_name: [*:0]const u8) ?[:0]const u8 {
            for (self.flag_data) |flag_data| {
                if (cstr.cmp(flag_data.name, flag_name) == 0) return flag_data.value.arg;
                if (cstr.cmp(flag_data.name, flag_name) == 0) {
                    return std.mem.span(flag_data.value.arg);
                }
            }
            unreachable; // Invalid flag_name
        }

M src/main.zig => src/main.zig +5 -5
@@ 372,23 372,23 @@ pub fn main() !void {
        os.exit(0);
    }
    if (result.argFlag("-view-padding")) |raw| {
        default_view_padding = std.fmt.parseUnsigned(u32, mem.span(raw), 10) catch
        default_view_padding = std.fmt.parseUnsigned(u32, raw, 10) catch
            fatalPrintUsage("invalid value '{s}' provided to -view-padding", .{raw});
    }
    if (result.argFlag("-outer-padding")) |raw| {
        default_outer_padding = std.fmt.parseUnsigned(u32, mem.span(raw), 10) catch
        default_outer_padding = std.fmt.parseUnsigned(u32, raw, 10) catch
            fatalPrintUsage("invalid value '{s}' provided to -outer-padding", .{raw});
    }
    if (result.argFlag("-main-location")) |raw| {
        default_main_location = std.meta.stringToEnum(Location, mem.span(raw)) orelse
        default_main_location = std.meta.stringToEnum(Location, raw) orelse
            fatalPrintUsage("invalid value '{s}' provided to -main-location", .{raw});
    }
    if (result.argFlag("-main-count")) |raw| {
        default_main_count = std.fmt.parseUnsigned(u32, mem.span(raw), 10) catch
        default_main_count = std.fmt.parseUnsigned(u32, raw, 10) catch
            fatalPrintUsage("invalid value '{s}' provided to -main-count", .{raw});
    }
    if (result.argFlag("-main-ratio")) |raw| {
        default_main_ratio = std.fmt.parseFloat(f64, mem.span(raw)) catch
        default_main_ratio = std.fmt.parseFloat(f64, raw) catch
            fatalPrintUsage("invalid value '{s}' provided to -main-ratio", .{raw});
    }
    if (result.boolFlag("-no-smart-gaps")) {