cmd: update to use new object system

This commit is contained in:
2025-10-19 21:02:12 +01:00
parent fd04a49d84
commit 34c54eb545
7 changed files with 36 additions and 41 deletions

View File

@@ -318,7 +318,7 @@ static b_status parse_short_opt(struct argv_parser *parser)
}
if (!opt) {
struct b_string *usage = z__b_command_default_usage_string(
b_string *usage = z__b_command_default_usage_string(
parser->cmd, NULL, parser->arglist);
b_err("unrecognised argument '" F_YELLOW "-%c" F_RESET
"'\n\n",
@@ -326,7 +326,7 @@ static b_status parse_short_opt(struct argv_parser *parser)
b_i("usage: %s", b_string_ptr(usage));
b_i("for more information, use '" F_YELLOW
"--help" F_RESET "'\n");
b_string_release(usage);
b_string_unref(usage);
return B_ERR_NO_ENTRY;
}
@@ -456,13 +456,13 @@ static b_status parse_long_opt(struct argv_parser *parser)
}
if (!opt && !subcmd) {
struct b_string *usage = z__b_command_default_usage_string(
b_string *usage = z__b_command_default_usage_string(
parser->cmd, NULL, parser->arglist);
b_err("unrecognised argument '" F_YELLOW "--%s" F_RESET
"'\n\nusage: %s\n\nfor more information, use '" F_YELLOW
"--help" F_RESET "'\n",
opt_name, b_string_ptr(usage));
b_string_release(usage);
b_string_unref(usage);
return B_ERR_NO_ENTRY;
}