cmd: improve command usage strings
the command usage strings now use the actual argument values provided by the user, in particular for the names of relevant commands
This commit is contained in:
12
cmd/report.c
12
cmd/report.c
@@ -57,8 +57,8 @@ 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(args->list_command, NULL);
|
||||
struct 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);
|
||||
b_i("usage: %s", b_string_ptr(usage));
|
||||
@@ -83,8 +83,8 @@ 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(args->list_command, opt);
|
||||
struct b_string *usage = z__b_command_default_usage_string(
|
||||
args->list_command, opt, args);
|
||||
struct b_string *opt_string = b_string_create();
|
||||
|
||||
if (opt) {
|
||||
@@ -139,8 +139,8 @@ enum b_status b_arglist_report_missing_args(
|
||||
: b_command_get_arg_with_id(args->list_command, arg_id);
|
||||
}
|
||||
|
||||
struct b_string *usage
|
||||
= z__b_command_default_usage_string(args->list_command, opt);
|
||||
struct b_string *usage = z__b_command_default_usage_string(
|
||||
args->list_command, opt, args);
|
||||
struct b_string *opt_string = b_string_create();
|
||||
|
||||
if (opt) {
|
||||
|
||||
Reference in New Issue
Block a user