From 412032596e9ce4b2a47e348477f5ad29b9ee0576 Mon Sep 17 00:00:00 2001 From: -k Date: Sun, 25 Aug 2024 00:39:00 -0700 Subject: [PATCH] fix: change help message types --- src/assets.zig | 2 +- src/main.zig | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/assets.zig b/src/assets.zig index a600099..8e86db3 100644 --- a/src/assets.zig +++ b/src/assets.zig @@ -13,5 +13,5 @@ pub const help_message = \\ ; -pub const opt_usage = "{u}{?u}{s} {s}{s?} <{s}:{s}>"; +pub const opt_usage = "{u}{?u}{s} {s}{s?} <{s}>"; pub const examples_header = "{s}EXAMPLE:\n"; diff --git a/src/main.zig b/src/main.zig index c8c37ea..2d0f6cf 100644 --- a/src/main.zig +++ b/src/main.zig @@ -38,7 +38,7 @@ pub const CommandT = cova.Command.Custom(.{ try writer.print("USAGE:\n", .{}); if (self.opts) |opts| { no_args = false; - try writer.print("{s}{s} ", .{ + try writer.print("{s}{s} [", .{ indent_fmt, self.name, }); @@ -47,11 +47,11 @@ pub const CommandT = cova.Command.Custom(.{ pre_sep, OptT.long_prefix orelse opt.short_prefix, opt.long_name orelse &.{opt.short_name orelse 0}, - opt.val.name(), + opt.val.childTypeName(), }); - pre_sep = "\n " ++ indent_fmt ++ indent_fmt; + pre_sep = "\n " ++ indent_fmt ++ indent_fmt; } - try writer.print("\n\n", .{}); + try writer.print(" ]\n\n", .{}); } if (self.sub_cmds) |cmds| { no_args = false; @@ -160,21 +160,21 @@ pub const setup_cmd: CommandT = .{ .description = "Set output color (default, red, green, blue, yellow, magenta).", .short_name = 'c', .long_name = "color", - .val = ValueT.ofType(Color, .{ .name = "string", .default_val = Color.default, .alias_child_type = "color" }), + .val = ValueT.ofType(Color, .{ .name = "color_val", .default_val = Color.default, .alias_child_type = "string" }), }, .{ .name = "style", .description = "Set output style (default, columns, crypto, grid, blocks).", .short_name = 's', .long_name = "style", - .val = ValueT.ofType(Style, .{ .name = "string", .default_val = Style.default, .alias_child_type = "style" }), + .val = ValueT.ofType(Style, .{ .name = "style_val", .default_val = Style.default, .alias_child_type = "string" }), }, .{ .name = "mode", .description = "Set symbol mode (binary, decimal).", .short_name = 'm', .long_name = "mode", - .val = ValueT.ofType(Mode, .{ .name = "string", .default_val = Mode.binary, .alias_child_type = "mode" }), + .val = ValueT.ofType(Mode, .{ .name = "mode_val", .default_val = Mode.binary, .alias_child_type = "string" }), }, .{ .name = "pulse", @@ -192,7 +192,7 @@ pub const setup_cmd: CommandT = .{ .short_name = 't', .long_name = "time", .val = ValueT.ofType(u32, .{ - .name = "integer", + .name = "time", .default_val = 0, }), },