cmd: update string api usage

This commit is contained in:
2026-05-02 14:30:27 +01:00
parent dbf50395d0
commit ce56eacafe
3 changed files with 19 additions and 19 deletions
+8 -8
View File
@@ -45,7 +45,7 @@ enum fx_status fx_arglist_report_missing_option(
fx_err("required option `" F_YELLOW "%s" F_RESET "` was not specified.",
fx_stringstream_ptr(opt_name));
fx_i("usage: %s", fx_string_ptr(opt_string));
fx_i("usage: %s", fx_string_get_cstr(opt_string));
fx_i("for more information, use `" F_YELLOW "--help" F_RESET "`");
fx_string_unref(opt_string);
@@ -61,7 +61,7 @@ enum fx_status fx_arglist_report_unexpected_arg(
args->list_command, NULL, args);
fx_err("unexpected argument '" F_YELLOW "%s" F_RESET "' found.", value);
fx_i("usage: %s", fx_string_ptr(usage));
fx_i("usage: %s", fx_string_get_cstr(usage));
fx_i("for more information, use '" F_YELLOW "--help" F_RESET "'");
return FX_SUCCESS;
@@ -95,16 +95,16 @@ enum fx_status fx_arglist_report_invalid_arg_value(
fx_err("invalid value '" F_YELLOW "%s" F_RESET "' for '" F_YELLOW
"%s" F_RESET "'.",
value, fx_string_ptr(opt_string));
value, fx_string_get_cstr(opt_string));
if (opt) {
fx_i("'" F_YELLOW "%s" F_RESET
"' accepts the following values for '" F_YELLOW "%s" F_RESET
"':",
fx_string_ptr(opt_string), arg->arg_name);
fx_string_get_cstr(opt_string), arg->arg_name);
} else {
fx_i("'" F_YELLOW "%s" F_RESET "' accepts the following values:",
fx_string_ptr(opt_string));
fx_string_get_cstr(opt_string));
}
for (int i = 0; arg->arg_allowed_values[i]; i++) {
@@ -114,7 +114,7 @@ enum fx_status fx_arglist_report_invalid_arg_value(
}
fx_printf("\n");
fx_i("usage: %s", fx_string_ptr(usage));
fx_i("usage: %s", fx_string_get_cstr(usage));
fx_i("for more information, use '" F_YELLOW "--help" F_RESET);
fx_string_unref(usage);
@@ -183,9 +183,9 @@ enum fx_status fx_arglist_report_missing_args(
fx_err("argument `" F_YELLOW "%s" F_RESET "` requires " F_GREEN_BOLD
"%s" F_RESET " `" F_YELLOW "%s" F_RESET "` value%s, but %s.",
fx_string_ptr(opt_string), required_arg_count, arg->arg_name,
fx_string_get_cstr(opt_string), required_arg_count, arg->arg_name,
(arg->arg_nr_values == 1) ? "" : "s", supplied_arg_str);
fx_i("usage: %s", fx_string_ptr(usage));
fx_i("usage: %s", fx_string_get_cstr(usage));
fx_i("for more information, use '" F_YELLOW "--help" F_RESET "'");
fx_string_unref(usage);