cmd: update to use new object system
This commit is contained in:
22
cmd/report.c
22
cmd/report.c
@@ -19,7 +19,7 @@ enum b_status b_arglist_report_missing_option(
|
||||
return B_ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
struct b_string *opt_string = b_string_create();
|
||||
b_string *opt_string = b_string_create();
|
||||
z__b_get_option_usage_string(opt, 0, opt_string);
|
||||
|
||||
char opt_name_s[128];
|
||||
@@ -50,7 +50,7 @@ enum b_status b_arglist_report_missing_option(
|
||||
b_i("usage: %s", b_string_ptr(opt_string));
|
||||
b_i("for more information, use `" F_YELLOW "--help" F_RESET "`");
|
||||
|
||||
b_string_release(opt_string);
|
||||
b_string_unref(opt_string);
|
||||
|
||||
return B_SUCCESS;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ enum b_status b_arglist_report_missing_option(
|
||||
enum b_status b_arglist_report_unexpected_arg(
|
||||
const b_arglist *args, const char *value)
|
||||
{
|
||||
struct b_string *usage = z__b_command_default_usage_string(
|
||||
b_string *usage = z__b_command_default_usage_string(
|
||||
args->list_command, NULL, args);
|
||||
|
||||
b_err("unexpected argument '" F_YELLOW "%s" F_RESET "' found.", value);
|
||||
@@ -84,9 +84,9 @@ enum b_status b_arglist_report_invalid_arg_value(
|
||||
: b_command_get_arg_with_id(args->list_command, arg_id);
|
||||
}
|
||||
|
||||
struct b_string *usage = z__b_command_default_usage_string(
|
||||
b_string *usage = z__b_command_default_usage_string(
|
||||
args->list_command, opt, args);
|
||||
struct b_string *opt_string = b_string_create();
|
||||
b_string *opt_string = b_string_create();
|
||||
|
||||
if (opt) {
|
||||
z__b_get_option_usage_string(opt, 0, opt_string);
|
||||
@@ -118,8 +118,8 @@ enum b_status b_arglist_report_invalid_arg_value(
|
||||
b_i("usage: %s", b_string_ptr(usage));
|
||||
b_i("for more information, use '" F_YELLOW "--help" F_RESET);
|
||||
|
||||
b_string_release(usage);
|
||||
b_string_release(opt_string);
|
||||
b_string_unref(usage);
|
||||
b_string_unref(opt_string);
|
||||
|
||||
return B_SUCCESS;
|
||||
}
|
||||
@@ -142,9 +142,9 @@ enum b_status b_arglist_report_missing_args(
|
||||
assert(arg);
|
||||
}
|
||||
|
||||
struct b_string *usage = z__b_command_default_usage_string(
|
||||
b_string *usage = z__b_command_default_usage_string(
|
||||
args->list_command, opt, args);
|
||||
struct b_string *opt_string = b_string_create();
|
||||
b_string *opt_string = b_string_create();
|
||||
|
||||
if (opt) {
|
||||
z__b_get_option_usage_string(opt, 0, opt_string);
|
||||
@@ -189,8 +189,8 @@ enum b_status b_arglist_report_missing_args(
|
||||
b_i("usage: %s", b_string_ptr(usage));
|
||||
b_i("for more information, use '" F_YELLOW "--help" F_RESET "'");
|
||||
|
||||
b_string_release(usage);
|
||||
b_string_release(opt_string);
|
||||
b_string_unref(usage);
|
||||
b_string_unref(opt_string);
|
||||
|
||||
return B_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user