cmd: update string api usage
This commit is contained in:
+8
-8
@@ -631,7 +631,7 @@ static void print_options_list(struct fx_command *cmd)
|
||||
}
|
||||
|
||||
fx_tty_puts(OUTPUT_STREAM, 0, " ");
|
||||
fx_tty_puts(OUTPUT_STREAM, 0, fx_string_ptr(opt_str));
|
||||
fx_tty_puts(OUTPUT_STREAM, 0, fx_string_get_cstr(opt_str));
|
||||
|
||||
if (new_paragraph) {
|
||||
format.p_flags = 0;
|
||||
@@ -650,7 +650,7 @@ static void print_options_list(struct fx_command *cmd)
|
||||
len++;
|
||||
}
|
||||
|
||||
fx_print_paragraph(fx_string_ptr(desc_str), OUTPUT_STREAM, &format);
|
||||
fx_print_paragraph(fx_string_get_cstr(desc_str), OUTPUT_STREAM, &format);
|
||||
|
||||
if (new_paragraph) {
|
||||
fx_tty_putc(OUTPUT_STREAM, 0, '\n');
|
||||
@@ -704,7 +704,7 @@ static void print_args_list(struct fx_command *cmd)
|
||||
z__fx_get_arg_usage_string(arg, true, str);
|
||||
|
||||
fx_tty_puts(OUTPUT_STREAM, 0, " ");
|
||||
fx_tty_puts(OUTPUT_STREAM, 0, fx_string_ptr(str));
|
||||
fx_tty_puts(OUTPUT_STREAM, 0, fx_string_get_cstr(str));
|
||||
unsigned int len = fx_string_get_size(
|
||||
str, FX_STRLEN_IGNORE_ESC
|
||||
| FX_STRLEN_IGNORE_MOD)
|
||||
@@ -717,7 +717,7 @@ static void print_args_list(struct fx_command *cmd)
|
||||
fx_string_clear(str);
|
||||
z__fx_get_arg_description(arg, str);
|
||||
|
||||
fx_print_paragraph(fx_string_ptr(str), OUTPUT_STREAM, &format);
|
||||
fx_print_paragraph(fx_string_get_cstr(str), OUTPUT_STREAM, &format);
|
||||
entry = fx_queue_next(entry);
|
||||
}
|
||||
|
||||
@@ -764,7 +764,7 @@ static void print_commands_list(struct fx_command *cmd)
|
||||
get_command_string(sub, str);
|
||||
|
||||
fx_tty_puts(OUTPUT_STREAM, 0, " ");
|
||||
fx_tty_puts(OUTPUT_STREAM, 0, fx_string_ptr(str));
|
||||
fx_tty_puts(OUTPUT_STREAM, 0, fx_string_get_cstr(str));
|
||||
unsigned int len = fx_string_get_size(
|
||||
str, FX_STRLEN_IGNORE_ESC
|
||||
| FX_STRLEN_IGNORE_MOD)
|
||||
@@ -777,7 +777,7 @@ static void print_commands_list(struct fx_command *cmd)
|
||||
fx_string_clear(str);
|
||||
get_command_description(sub, str);
|
||||
|
||||
fx_print_paragraph(fx_string_ptr(str), OUTPUT_STREAM, &format);
|
||||
fx_print_paragraph(fx_string_get_cstr(str), OUTPUT_STREAM, &format);
|
||||
|
||||
entry = fx_queue_next(entry);
|
||||
}
|
||||
@@ -941,7 +941,7 @@ static void print_usage(struct fx_command *cmd, struct fx_arglist *args)
|
||||
if (fx_queue_empty(&cmd->c_usage)) {
|
||||
fx_string *usage
|
||||
= z__fx_command_default_usage_string(cmd, NULL, args);
|
||||
fx_print_paragraph(fx_string_ptr(usage), OUTPUT_STREAM, &format);
|
||||
fx_print_paragraph(fx_string_get_cstr(usage), OUTPUT_STREAM, &format);
|
||||
fx_string_unref(usage);
|
||||
return;
|
||||
}
|
||||
@@ -954,7 +954,7 @@ static void print_usage(struct fx_command *cmd, struct fx_arglist *args)
|
||||
|
||||
fx_string_clear(str);
|
||||
get_usage_string(cmd, args, usage, str);
|
||||
fx_print_paragraph(fx_string_ptr(str), OUTPUT_STREAM, &format);
|
||||
fx_print_paragraph(fx_string_get_cstr(str), OUTPUT_STREAM, &format);
|
||||
|
||||
entry = fx_queue_next(entry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user