00JCIV00/cova

Global command option to set the default format strings to "".

p7r0x7 opened this issue · 2 comments

p7r0x7 commented

I use custom callbacks for everything, so I don't need these strings to exist in my binaries.
This chaos could be mitigated with a global command option to set the default format strings to "".

/// Cova configuration type identity
const CommandT = cova.Command.Custom(.{
    .cmd_alias_fmt = "",
    .help_header_fmt = "",
    .subcmd_alias_fmt = "",
    .subcmds_help_fmt = "",
    .subcmds_usage_fmt = "",
    .subcmds_help_title_fmt = "",
    .vals_help_title_fmt = "",
    .opts_help_title_fmt = "",
    .usage_header_fmt = "",
    .group_title_fmt = "",
    .group_sep_fmt = "",

    .indent_fmt = "    ",
    .global_help_prefix = "",
    .global_case_sensitive = false,
    .global_vals_mandatory = false,
    .global_sub_cmds_mandatory = false,
    .global_usage_fn = printers.commandUsage,
    .global_help_fn = printers.commandHelp,
    .opt_config = .{
        .help_fmt = "",
        .usage_fmt = "",
        .global_usage_fn = printers.optionUsage,
        .global_help_fn = printers.optionHelp,
        .allow_abbreviated_long_opts = false,
        .allow_opt_val_no_space = true,
        .opt_val_seps = "=:",
        .short_prefix = null,
        .long_prefix = "-",
    },
    .val_config = .{
        .help_fmt = "",
        .usage_fmt = "",
        .global_usage_fn = printers.valueUsage,
        .global_help_fn = printers.valueHelp,
        .global_set_behavior = .Last,
        .add_base_floats = false,
        .add_base_ints = false,
        .use_slim_base = true,
        .max_children = 1,
    },
});

I have this all loaded up in a commit. It just isn't pushed yet.

Added in commit b2520ab