From: Kevin Day Date: Sun, 26 Apr 2020 04:00:43 +0000 (-0500) Subject: Cleanup: the standard print help functions only need color context X-Git-Tag: 0.5.0~328 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=d9cc0cffcb06b506892f97eb930960c1ece2e2c6;p=fll Cleanup: the standard print help functions only need color context Passing the entire program data structure is not necessary. Just pass the color context, this simplifies the code. --- diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 51b6b53..6f510c4 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -6,50 +6,50 @@ extern "C" { #endif #ifndef _di_byte_dump_print_help_ - f_return_status byte_dump_print_help(const byte_dump_data data) { - fll_program_print_help_header(data.context, byte_dump_name_long, byte_dump_version); + f_return_status byte_dump_print_help(const fl_color_context context) { + fll_program_print_help_header(context, byte_dump_name_long, byte_dump_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, " Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, " Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, byte_dump_short_binary, byte_dump_long_binary, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display binary representation."); - fll_program_print_help_option(data.context, byte_dump_short_decimal, byte_dump_long_decimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display decimal representation."); - fll_program_print_help_option(data.context, byte_dump_short_duodecimal, byte_dump_long_duodecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display duodecimal representation."); - fll_program_print_help_option(data.context, byte_dump_short_hexidecimal, byte_dump_long_hexidecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, "Display hexadecimal representation."); - fll_program_print_help_option(data.context, byte_dump_short_octal, byte_dump_long_octal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display octal representation."); + fll_program_print_help_option(context, byte_dump_short_binary, byte_dump_long_binary, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display binary representation."); + fll_program_print_help_option(context, byte_dump_short_decimal, byte_dump_long_decimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display decimal representation."); + fll_program_print_help_option(context, byte_dump_short_duodecimal, byte_dump_long_duodecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display duodecimal representation."); + fll_program_print_help_option(context, byte_dump_short_hexidecimal, byte_dump_long_hexidecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, "Display hexadecimal representation."); + fll_program_print_help_option(context, byte_dump_short_octal, byte_dump_long_octal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display octal representation."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, byte_dump_short_first, byte_dump_long_first, f_console_symbol_short_enable, f_console_symbol_long_enable, " Start reading at this byte offset."); - fll_program_print_help_option(data.context, byte_dump_short_last, byte_dump_long_last, f_console_symbol_short_enable, f_console_symbol_long_enable, " Stop reading at this (inclusive) byte offset."); - fll_program_print_help_option(data.context, byte_dump_short_width, byte_dump_long_width, f_console_symbol_short_enable, f_console_symbol_long_enable, " Set number of columns of Bytes to display."); + fll_program_print_help_option(context, byte_dump_short_first, byte_dump_long_first, f_console_symbol_short_enable, f_console_symbol_long_enable, " Start reading at this byte offset."); + fll_program_print_help_option(context, byte_dump_short_last, byte_dump_long_last, f_console_symbol_short_enable, f_console_symbol_long_enable, " Stop reading at this (inclusive) byte offset."); + fll_program_print_help_option(context, byte_dump_short_width, byte_dump_long_width, f_console_symbol_short_enable, f_console_symbol_long_enable, " Set number of columns of Bytes to display."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, byte_dump_short_text, byte_dump_long_text, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include a column of text when displaying the bytes."); - fll_program_print_help_option(data.context, byte_dump_short_placeholder, byte_dump_long_placeholder, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use a placeholder character instead of a space for placeholders."); + fll_program_print_help_option(context, byte_dump_short_text, byte_dump_long_text, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include a column of text when displaying the bytes."); + fll_program_print_help_option(context, byte_dump_short_placeholder, byte_dump_long_placeholder, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use a placeholder character instead of a space for placeholders."); printf("%c", f_string_eol); - fll_program_print_help_option_long(data.context, byte_dump_long_normal, f_console_symbol_long_enable, " Display UTF-8 symbols for ASCII control codes."); - fll_program_print_help_option_long(data.context, byte_dump_long_simple, f_console_symbol_long_enable, " Display spaces for ASCII control codes."); - fll_program_print_help_option_long(data.context, byte_dump_long_classic, f_console_symbol_long_enable, " Display periods for ASCII control codes."); + fll_program_print_help_option_long(context, byte_dump_long_normal, f_console_symbol_long_enable, " Display UTF-8 symbols for ASCII control codes."); + fll_program_print_help_option_long(context, byte_dump_long_simple, f_console_symbol_long_enable, " Display spaces for ASCII control codes."); + fll_program_print_help_option_long(context, byte_dump_long_classic, f_console_symbol_long_enable, " Display periods for ASCII control codes."); - fll_program_print_help_usage(data.context, byte_dump_name, "filename(s)"); + fll_program_print_help_usage(context, byte_dump_name, "filename(s)"); printf(" When using the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", byte_dump_long_text); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", byte_dump_long_text); printf(" option, some UTF-8 characters may be replaced by your instance and cause display alignment issues."); printf("%c%c", f_string_eol, f_string_eol); printf(" Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", byte_dump_long_placeholder); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", byte_dump_long_placeholder); printf(" option is used)."); printf("%c%c", f_string_eol, f_string_eol); @@ -59,7 +59,7 @@ extern "C" { printf("%c%c", f_string_eol, f_string_eol); printf(" When "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", byte_dump_long_last); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", byte_dump_long_last); printf(" is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range."); printf("%c%c", f_string_eol, f_string_eol); @@ -150,7 +150,7 @@ extern "C" { status = f_none; if (data->parameters[byte_dump_parameter_help].result == f_console_result_found) { - byte_dump_print_help(*data); + byte_dump_print_help(data->context); } else if (data->parameters[byte_dump_parameter_version].result == f_console_result_found) { fll_program_print_version(byte_dump_version); diff --git a/level_3/byte_dump/c/byte_dump.h b/level_3/byte_dump/c/byte_dump.h index 227d30d..c21b5ef 100644 --- a/level_3/byte_dump/c/byte_dump.h +++ b/level_3/byte_dump/c/byte_dump.h @@ -229,14 +229,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_byte_dump_print_help_ - extern f_return_status byte_dump_print_help(const byte_dump_data data); + extern f_return_status byte_dump_print_help(const fl_color_context context); #endif // _di_byte_dump_print_help_ /** diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 3fada99..d426b17 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -12,43 +12,43 @@ extern "C" { #endif #ifndef _di_firewall_print_help_ - f_return_status firewall_print_help(const firewall_data data) { - fll_program_print_help_header(data.context, firewall_name_long, firewall_version); + f_return_status firewall_print_help(const fl_color_context context) { + fll_program_print_help_header(context, firewall_name_long, firewall_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); #ifdef _en_firewall_debug_ - fll_program_print_help_option(data.context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging."); + fll_program_print_help_option(context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging."); #endif // _en_firewall_debug_ printf("%c%c", f_string_eol, f_string_eol); - fl_color_print(f_standard_output, data.context.important, data.context.reset, " Available Commands: "); + fl_color_print(f_standard_output, context.important, context.reset, " Available Commands: "); printf("%c ", f_string_eol); - fl_color_print(f_standard_output, data.context.standout, data.context.reset, firewall_command_start); + fl_color_print(f_standard_output, context.standout, context.reset, firewall_command_start); printf(" Turn on the firewall"); printf("%c ", f_string_eol); - fl_color_print(f_standard_output, data.context.standout, data.context.reset, firewall_command_stop); + fl_color_print(f_standard_output, context.standout, context.reset, firewall_command_stop); printf(" Turn off the firewall"); printf("%c ", f_string_eol); - fl_color_print(f_standard_output, data.context.standout, data.context.reset, firewall_command_restart); + fl_color_print(f_standard_output, context.standout, context.reset, firewall_command_restart); printf(" Turn off and then turn on the firewall"); printf("%c ", f_string_eol); - fl_color_print(f_standard_output, data.context.standout, data.context.reset, firewall_command_lock); + fl_color_print(f_standard_output, context.standout, context.reset, firewall_command_lock); printf(" Prevent all communication"); printf("%c ", f_string_eol); - fl_color_print(f_standard_output, data.context.standout, data.context.reset, firewall_command_show); + fl_color_print(f_standard_output, context.standout, context.reset, firewall_command_show); printf(" Show active firewall settings"); - fll_program_print_help_usage(data.context, firewall_name, "command"); + fll_program_print_help_usage(context, firewall_name, "command"); return f_none; } @@ -74,7 +74,7 @@ extern "C" { status = f_none; if (data->parameters[firewall_parameter_help].result == f_console_result_found) { - firewall_print_help(*data); + firewall_print_help(data->context); } else if (data->parameters[firewall_parameter_version].result == f_console_result_found) { fll_program_print_version(firewall_version); diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index d92915d..fef1286 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -299,14 +299,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_firewall_print_help_ - extern f_return_status firewall_print_help(const firewall_data data); + extern f_return_status firewall_print_help(const fl_color_context context); #endif // _di_firewall_print_help_ /** diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.c b/level_3/fss_basic_list_read/c/fss_basic_list_read.c index 3a6fd7e..5fdc89d 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.c @@ -6,30 +6,30 @@ extern "C" { #endif #ifndef _di_fss_basic_list_read_print_help_ - f_return_status fss_basic_list_read_print_help(const fss_basic_list_read_data data) { - fll_program_print_help_header(data.context, fss_basic_list_read_name_long, fss_basic_list_read_version); + f_return_status fss_basic_list_read_print_help(const fl_color_context context) { + fll_program_print_help_header(context, fss_basic_list_read_name_long, fss_basic_list_read_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, fss_basic_list_read_short_at, fss_basic_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); - fll_program_print_help_option(data.context, fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth."); - fll_program_print_help_option(data.context, fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing."); - fll_program_print_help_option(data.context, fss_basic_list_read_short_line, fss_basic_list_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line."); - fll_program_print_help_option(data.context, fss_basic_list_read_short_name, fss_basic_list_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name."); - fll_program_print_help_option(data.context, fss_basic_list_read_short_object, fss_basic_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content."); - fll_program_print_help_option(data.context, fss_basic_list_read_short_select, fss_basic_list_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index."); - fll_program_print_help_option(data.context, fss_basic_list_read_short_total, fss_basic_list_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines."); - fll_program_print_help_option(data.context, fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print."); + fll_program_print_help_option(context, fss_basic_list_read_short_at, fss_basic_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); + fll_program_print_help_option(context, fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth."); + fll_program_print_help_option(context, fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing."); + fll_program_print_help_option(context, fss_basic_list_read_short_line, fss_basic_list_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line."); + fll_program_print_help_option(context, fss_basic_list_read_short_name, fss_basic_list_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name."); + fll_program_print_help_option(context, fss_basic_list_read_short_object, fss_basic_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content."); + fll_program_print_help_option(context, fss_basic_list_read_short_select, fss_basic_list_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index."); + fll_program_print_help_option(context, fss_basic_list_read_short_total, fss_basic_list_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines."); + fll_program_print_help_option(context, fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print."); - fll_program_print_help_usage(data.context, fss_basic_list_read_name, "filename(s)"); + fll_program_print_help_usage(context, fss_basic_list_read_name, "filename(s)"); - fl_color_print(f_standard_output, data.context.important, data.context.reset, " Notes:"); + fl_color_print(f_standard_output, context.important, context.reset, " Notes:"); printf("%c", f_string_eol, f_string_eol); @@ -38,27 +38,27 @@ extern "C" { printf("%c", f_string_eol); printf(" When using the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_depth); printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol); printf(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_at); printf(": An object index at the specified depth.%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_depth); printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_name); printf(": An object name at the specified depth.%c", f_string_eol); printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_depth); printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol); printf(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol); printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol); @@ -66,53 +66,53 @@ extern "C" { printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_select); printf(" selects a content index at a given depth.%c", f_string_eol); printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol); printf("%c", f_string_eol); printf(" Specify both "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_object); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_object); printf(" and the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_total); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_total); printf(" parameters to get the total objects.%c", f_string_eol); printf("%c", f_string_eol); printf(" When both "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_at); printf(" and "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_name); printf(" parameters are specified (at the same depth), the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_at); printf(" parameter value will be treated as a position relative to the specified "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_name); printf(" parameter value.%c", f_string_eol); printf("%c", f_string_eol); printf(" This program may support parameters, such as "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_depth); printf(" or "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_select); printf(", even if not supported by the standard.%c", f_string_eol); printf(" This is done to help ensure consistency for scripting.%c", f_string_eol); printf("%c", f_string_eol); printf(" For parameters like "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_depth); printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol); printf(" For parameters like "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_select); printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol); printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_list_read_long_trim); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_list_read_long_trim); printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol); printf("%c", f_string_eol); @@ -141,7 +141,7 @@ extern "C" { } if (data->parameters[fss_basic_list_read_parameter_help].result == f_console_result_found) { - fss_basic_list_read_print_help(*data); + fss_basic_list_read_print_help(data->context); } else if (data->parameters[fss_basic_list_read_parameter_version].result == f_console_result_found) { fll_program_print_version(fss_basic_list_read_version); diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.h b/level_3/fss_basic_list_read/c/fss_basic_list_read.h index 8da0d4d..c9d509d 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.h @@ -147,14 +147,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_fss_basic_list_read_print_help_ - extern f_return_status fss_basic_list_read_print_help(const fss_basic_list_read_data data); + extern f_return_status fss_basic_list_read_print_help(const fl_color_context context); #endif // _di_fss_basic_list_read_print_help_ /** diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.c b/level_3/fss_basic_list_write/c/fss_basic_list_write.c index f986d87..fcb3f21 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.c @@ -5,22 +5,22 @@ extern "C" { #endif #ifndef _di_fss_basic_list_write_print_help_ - f_return_status fss_basic_list_write_print_help(const fss_basic_list_write_data data) { - fll_program_print_help_header(data.context, fss_basic_list_write_name_long, fss_basic_list_write_version); + f_return_status fss_basic_list_write_print_help(const fl_color_context context) { + fll_program_print_help_header(context, fss_basic_list_write_name_long, fss_basic_list_write_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, fss_basic_list_write_short_object, fss_basic_list_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Write an object instead of content."); - fll_program_print_help_option(data.context, fss_basic_list_write_short_file, fss_basic_list_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to."); - fll_program_print_help_option(data.context, fss_basic_list_write_short_string, fss_basic_list_write_long_string, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a string to convert."); + fll_program_print_help_option(context, fss_basic_list_write_short_object, fss_basic_list_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Write an object instead of content."); + fll_program_print_help_option(context, fss_basic_list_write_short_file, fss_basic_list_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to."); + fll_program_print_help_option(context, fss_basic_list_write_short_string, fss_basic_list_write_long_string, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a string to convert."); - fll_program_print_help_usage(data.context, fss_basic_list_write_name, ""); + fll_program_print_help_usage(context, fss_basic_list_write_name, ""); return f_none; } @@ -46,7 +46,7 @@ extern "C" { status = f_none; if (data->parameters[fss_basic_list_write_parameter_help].result == f_console_result_found) { - fss_basic_list_write_print_help(*data); + fss_basic_list_write_print_help(data->context); } else if (data->parameters[fss_basic_list_write_parameter_version].result == f_console_result_found) { fll_program_print_version(fss_basic_list_write_version); diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.h b/level_3/fss_basic_list_write/c/fss_basic_list_write.h index d8237a3..5d19cf6 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.h +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.h @@ -107,14 +107,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_fss_basic_list_write_print_help_ - extern f_return_status fss_basic_list_write_print_help(const fss_basic_list_write_data data); + extern f_return_status fss_basic_list_write_print_help(const fl_color_context context); #endif // _di_fss_basic_list_write_print_help_ /** diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index c225d54..4863db5 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -6,30 +6,30 @@ extern "C" { #endif #ifndef _di_fss_basic_read_print_help_ - f_return_status fss_basic_read_print_help(const fss_basic_read_data data) { - fll_program_print_help_header(data.context, fss_basic_read_name_long, fss_basic_read_version); + f_return_status fss_basic_read_print_help(const fl_color_context context) { + fll_program_print_help_header(context, fss_basic_read_name_long, fss_basic_read_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, fss_basic_read_short_at, fss_basic_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); - fll_program_print_help_option(data.context, fss_basic_read_short_depth, fss_basic_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth."); - fll_program_print_help_option(data.context, fss_basic_read_short_empty, fss_basic_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing."); - fll_program_print_help_option(data.context, fss_basic_read_short_line, fss_basic_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line."); - fll_program_print_help_option(data.context, fss_basic_read_short_name, fss_basic_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name."); - fll_program_print_help_option(data.context, fss_basic_read_short_object, fss_basic_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content."); - fll_program_print_help_option(data.context, fss_basic_read_short_select, fss_basic_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index."); - fll_program_print_help_option(data.context, fss_basic_read_short_total, fss_basic_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines."); - fll_program_print_help_option(data.context, fss_basic_read_short_trim, fss_basic_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print."); + fll_program_print_help_option(context, fss_basic_read_short_at, fss_basic_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); + fll_program_print_help_option(context, fss_basic_read_short_depth, fss_basic_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth."); + fll_program_print_help_option(context, fss_basic_read_short_empty, fss_basic_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing."); + fll_program_print_help_option(context, fss_basic_read_short_line, fss_basic_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line."); + fll_program_print_help_option(context, fss_basic_read_short_name, fss_basic_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name."); + fll_program_print_help_option(context, fss_basic_read_short_object, fss_basic_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content."); + fll_program_print_help_option(context, fss_basic_read_short_select, fss_basic_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index."); + fll_program_print_help_option(context, fss_basic_read_short_total, fss_basic_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines."); + fll_program_print_help_option(context, fss_basic_read_short_trim, fss_basic_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print."); - fll_program_print_help_usage(data.context, fss_basic_read_name, "filename(s)"); + fll_program_print_help_usage(context, fss_basic_read_name, "filename(s)"); - fl_color_print(f_standard_output, data.context.important, data.context.reset, " Notes:"); + fl_color_print(f_standard_output, context.important, context.reset, " Notes:"); printf("%c", f_string_eol, f_string_eol); @@ -38,27 +38,27 @@ extern "C" { printf("%c", f_string_eol); printf(" When using the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_depth); printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol); printf(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_at); printf(": An object index at the specified depth.%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_depth); printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_name); printf(": An object name at the specified depth.%c", f_string_eol); printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_depth); printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol); printf(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol); printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol); @@ -66,53 +66,53 @@ extern "C" { printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_select); printf(" selects a content index at a given depth.%c", f_string_eol); printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol); printf("%c", f_string_eol); printf(" Specify both "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_object); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_object); printf(" and the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_total); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_total); printf(" parameters to get the total objects.%c", f_string_eol); printf("%c", f_string_eol); printf(" When both "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_at); printf(" and "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_name); printf(" parameters are specified (at the same depth), the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_at); printf(" parameter value will be treated as a position relative to the specified "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_name); printf(" parameter value.%c", f_string_eol); printf("%c", f_string_eol); printf(" This program may support parameters, such as "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_depth); printf(" or "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_select); printf(", even if not supported by the standard.%c", f_string_eol); printf(" This is done to help ensure consistency for scripting.%c", f_string_eol); printf("%c", f_string_eol); printf(" For parameters like "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_depth); printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol); printf(" For parameters like "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_select); printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol); printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_basic_read_long_trim); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_basic_read_long_trim); printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol); printf("%c", f_string_eol); @@ -141,7 +141,7 @@ extern "C" { } if (data->parameters[fss_basic_read_parameter_help].result == f_console_result_found) { - fss_basic_read_print_help(*data); + fss_basic_read_print_help(data->context); } else if (data->parameters[fss_basic_read_parameter_version].result == f_console_result_found) { fll_program_print_version(fss_basic_read_version); diff --git a/level_3/fss_basic_read/c/fss_basic_read.h b/level_3/fss_basic_read/c/fss_basic_read.h index ed7eac5..665c0ef 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -147,14 +147,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_fss_basic_read_print_help_ - extern f_return_status fss_basic_read_print_help(const fss_basic_read_data data); + extern f_return_status fss_basic_read_print_help(const fl_color_context context); #endif // _di_fss_basic_read_print_help_ /** diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index d989239..1266f28 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -5,22 +5,22 @@ extern "C" { #endif #ifndef _di_fss_basic_write_print_help_ - f_return_status fss_basic_write_print_help(const fss_basic_write_data data) { - fll_program_print_help_header(data.context, fss_basic_write_name_long, fss_basic_write_version); + f_return_status fss_basic_write_print_help(const fl_color_context context) { + fll_program_print_help_header(context, fss_basic_write_name_long, fss_basic_write_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, fss_basic_write_short_object, fss_basic_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Write an object instead of content."); - fll_program_print_help_option(data.context, fss_basic_write_short_file, fss_basic_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to."); - fll_program_print_help_option(data.context, fss_basic_write_short_string, fss_basic_write_long_string, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a string to convert."); + fll_program_print_help_option(context, fss_basic_write_short_object, fss_basic_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Write an object instead of content."); + fll_program_print_help_option(context, fss_basic_write_short_file, fss_basic_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to."); + fll_program_print_help_option(context, fss_basic_write_short_string, fss_basic_write_long_string, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a string to convert."); - fll_program_print_help_usage(data.context, fss_basic_write_name, ""); + fll_program_print_help_usage(context, fss_basic_write_name, ""); return f_none; } @@ -46,7 +46,7 @@ extern "C" { status = f_none; if (data->parameters[fss_basic_write_parameter_help].result == f_console_result_found) { - fss_basic_write_print_help(*data); + fss_basic_write_print_help(data->context); } else if (data->parameters[fss_basic_write_parameter_version].result == f_console_result_found) { fll_program_print_version(fss_basic_write_version); diff --git a/level_3/fss_basic_write/c/fss_basic_write.h b/level_3/fss_basic_write/c/fss_basic_write.h index ddc537f..d61759c 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -106,14 +106,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_fss_basic_write_print_help_ - extern f_return_status fss_basic_write_print_help(const fss_basic_write_data data); + extern f_return_status fss_basic_write_print_help(const fl_color_context context); #endif // _di_fss_basic_write_print_help_ /** diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.c b/level_3/fss_extended_list_read/c/fss_extended_list_read.c index dd9909d..5eea8d6 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.c @@ -6,30 +6,30 @@ extern "C" { #endif #ifndef _di_fss_extended_list_read_print_help_ - f_return_status fss_extended_list_read_print_help(const fss_extended_list_read_data data) { - fll_program_print_help_header(data.context, fss_extended_list_read_name_long, fss_extended_list_read_version); + f_return_status fss_extended_list_read_print_help(const fl_color_context context) { + fll_program_print_help_header(context, fss_extended_list_read_name_long, fss_extended_list_read_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, fss_extended_list_read_short_at, fss_extended_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); - fll_program_print_help_option(data.context, fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth."); - fll_program_print_help_option(data.context, fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing."); - fll_program_print_help_option(data.context, fss_extended_list_read_short_line, fss_extended_list_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line."); - fll_program_print_help_option(data.context, fss_extended_list_read_short_name, fss_extended_list_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name."); - fll_program_print_help_option(data.context, fss_extended_list_read_short_object, fss_extended_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content."); - fll_program_print_help_option(data.context, fss_extended_list_read_short_select, fss_extended_list_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index."); - fll_program_print_help_option(data.context, fss_extended_list_read_short_total, fss_extended_list_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines."); - fll_program_print_help_option(data.context, fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print."); + fll_program_print_help_option(context, fss_extended_list_read_short_at, fss_extended_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); + fll_program_print_help_option(context, fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth."); + fll_program_print_help_option(context, fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing."); + fll_program_print_help_option(context, fss_extended_list_read_short_line, fss_extended_list_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line."); + fll_program_print_help_option(context, fss_extended_list_read_short_name, fss_extended_list_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name."); + fll_program_print_help_option(context, fss_extended_list_read_short_object, fss_extended_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content."); + fll_program_print_help_option(context, fss_extended_list_read_short_select, fss_extended_list_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index."); + fll_program_print_help_option(context, fss_extended_list_read_short_total, fss_extended_list_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines."); + fll_program_print_help_option(context, fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print."); - fll_program_print_help_usage(data.context, fss_extended_list_read_name, "filename(s)"); + fll_program_print_help_usage(context, fss_extended_list_read_name, "filename(s)"); - fl_color_print(f_standard_output, data.context.important, data.context.reset, " Notes:"); + fl_color_print(f_standard_output, context.important, context.reset, " Notes:"); printf("%c", f_string_eol, f_string_eol); @@ -38,27 +38,27 @@ extern "C" { printf("%c", f_string_eol); printf(" When using the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_depth); printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol); printf(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_at); printf(": An object index at the specified depth.%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_depth); printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_name); printf(": An object name at the specified depth.%c", f_string_eol); printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_depth); printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol); printf(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol); printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol); @@ -66,53 +66,53 @@ extern "C" { printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_select); printf(" selects a content index at a given depth.%c", f_string_eol); printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol); printf("%c", f_string_eol); printf(" Specify both "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_object); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_object); printf(" and the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_total); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_total); printf(" parameters to get the total objects.%c", f_string_eol); printf("%c", f_string_eol); printf(" When both "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_at); printf(" and "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_name); printf(" parameters are specified (at the same depth), the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_at); printf(" parameter value will be treated as a position relative to the specified "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_name); printf(" parameter value.%c", f_string_eol); printf("%c", f_string_eol); printf(" This program may support parameters, such as "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_depth); printf(" or "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_select); printf(", even if not supported by the standard.%c", f_string_eol); printf(" This is done to help ensure consistency for scripting.%c", f_string_eol); printf("%c", f_string_eol); printf(" For parameters like "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_depth); printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol); printf(" For parameters like "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_select); printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol); printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_list_read_long_trim); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_list_read_long_trim); printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol); printf("%c", f_string_eol); @@ -141,7 +141,7 @@ extern "C" { } if (data->parameters[fss_extended_list_read_parameter_help].result == f_console_result_found) { - fss_extended_list_read_print_help(*data); + fss_extended_list_read_print_help(data->context); } else if (data->parameters[fss_extended_list_read_parameter_version].result == f_console_result_found) { fll_program_print_version(fss_extended_list_read_version); diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.h b/level_3/fss_extended_list_read/c/fss_extended_list_read.h index cb1a423..3cf1c40 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.h @@ -145,14 +145,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_fss_extended_list_read_print_help_ - extern f_return_status fss_extended_list_read_print_help(const fss_extended_list_read_data data); + extern f_return_status fss_extended_list_read_print_help(const fl_color_context context); #endif // _di_fss_extended_list_read_print_help_ /** diff --git a/level_3/fss_extended_read/c/fss_extended_read.c b/level_3/fss_extended_read/c/fss_extended_read.c index 91a712a..d12c398 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -6,30 +6,30 @@ extern "C" { #endif #ifndef _di_fss_extended_read_print_help_ - f_return_status fss_extended_read_print_help(const fss_extended_read_data data) { - fll_program_print_help_header(data.context, fss_extended_read_name_long, fss_extended_read_version); + f_return_status fss_extended_read_print_help(const fl_color_context context) { + fll_program_print_help_header(context, fss_extended_read_name_long, fss_extended_read_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, fss_extended_read_short_at, fss_extended_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); - fll_program_print_help_option(data.context, fss_extended_read_short_depth, fss_extended_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth."); - fll_program_print_help_option(data.context, fss_extended_read_short_empty, fss_extended_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing."); - fll_program_print_help_option(data.context, fss_extended_read_short_line, fss_extended_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line."); - fll_program_print_help_option(data.context, fss_extended_read_short_name, fss_extended_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name."); - fll_program_print_help_option(data.context, fss_extended_read_short_object, fss_extended_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content."); - fll_program_print_help_option(data.context, fss_extended_read_short_select, fss_extended_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index."); - fll_program_print_help_option(data.context, fss_extended_read_short_total, fss_extended_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines."); - fll_program_print_help_option(data.context, fss_extended_read_short_trim, fss_extended_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print."); + fll_program_print_help_option(context, fss_extended_read_short_at, fss_extended_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); + fll_program_print_help_option(context, fss_extended_read_short_depth, fss_extended_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth."); + fll_program_print_help_option(context, fss_extended_read_short_empty, fss_extended_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing."); + fll_program_print_help_option(context, fss_extended_read_short_line, fss_extended_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line."); + fll_program_print_help_option(context, fss_extended_read_short_name, fss_extended_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name."); + fll_program_print_help_option(context, fss_extended_read_short_object, fss_extended_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content."); + fll_program_print_help_option(context, fss_extended_read_short_select, fss_extended_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index."); + fll_program_print_help_option(context, fss_extended_read_short_total, fss_extended_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines."); + fll_program_print_help_option(context, fss_extended_read_short_trim, fss_extended_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print."); - fll_program_print_help_usage(data.context, fss_extended_read_name, "filename(s)"); + fll_program_print_help_usage(context, fss_extended_read_name, "filename(s)"); - fl_color_print(f_standard_output, data.context.important, data.context.reset, " Notes:"); + fl_color_print(f_standard_output, context.important, context.reset, " Notes:"); printf("%c", f_string_eol, f_string_eol); @@ -38,27 +38,27 @@ extern "C" { printf("%c", f_string_eol); printf(" When using the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_depth); printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol); printf(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_at); printf(": An object index at the specified depth.%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_depth); printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol); printf(" "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_name); printf(": An object name at the specified depth.%c", f_string_eol); printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_depth); printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol); printf(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol); printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol); @@ -66,53 +66,53 @@ extern "C" { printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_select); printf(" selects a content index at a given depth.%c", f_string_eol); printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol); printf("%c", f_string_eol); printf(" Specify both "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_object); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_object); printf(" and the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_total); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_total); printf(" parameters to get the total objects.%c", f_string_eol); printf("%c", f_string_eol); printf(" When both "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_at); printf(" and "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_name); printf(" parameters are specified (at the same depth), the "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_at); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_at); printf(" parameter value will be treated as a position relative to the specified "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_name); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_name); printf(" parameter value.%c", f_string_eol); printf("%c", f_string_eol); printf(" This program may support parameters, such as "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_depth); printf(" or "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_select); printf(", even if not supported by the standard.%c", f_string_eol); printf(" This is done to help ensure consistency for scripting.%c", f_string_eol); printf("%c", f_string_eol); printf(" For parameters like "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_depth); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_depth); printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol); printf(" For parameters like "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_select); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_select); printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol); printf("%c", f_string_eol); printf(" The parameter "); - fl_color_print(f_standard_output, data.context.notable, data.context.reset, "--%s", fss_extended_read_long_trim); + fl_color_print(f_standard_output, context.notable, context.reset, "--%s", fss_extended_read_long_trim); printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol); printf("%c", f_string_eol); @@ -141,7 +141,7 @@ extern "C" { } if (data->parameters[fss_extended_read_parameter_help].result == f_console_result_found) { - fss_extended_read_print_help(*data); + fss_extended_read_print_help(data->context); } else if (data->parameters[fss_extended_read_parameter_version].result == f_console_result_found) { fll_program_print_version(fss_extended_read_version); diff --git a/level_3/fss_extended_read/c/fss_extended_read.h b/level_3/fss_extended_read/c/fss_extended_read.h index 46c0208..b2798ec 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -147,14 +147,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_fss_extended_read_print_help_ - extern f_return_status fss_extended_read_print_help(const fss_extended_read_data data); + extern f_return_status fss_extended_read_print_help(const fl_color_context context); #endif // _di_fss_extended_read_print_help_ /** diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index 6bf58c9..7456261 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -5,23 +5,23 @@ extern "C" { #endif #ifndef _di_fss_extended_write_print_help_ - f_return_status fss_extended_write_print_help(const fss_extended_write_data data) { - fll_program_print_help_header(data.context, fss_extended_write_name_long, fss_extended_write_version); + f_return_status fss_extended_write_print_help(const fl_color_context context) { + fll_program_print_help_header(context, fss_extended_write_name_long, fss_extended_write_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, fss_extended_write_short_object, fss_extended_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Write an object instead of content."); - fll_program_print_help_option(data.context, fss_extended_write_short_file, fss_extended_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to."); - fll_program_print_help_option(data.context, fss_extended_write_short_string, fss_extended_write_long_string, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a string to convert."); - fll_program_print_help_option(data.context, fss_extended_write_short_partial, fss_extended_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, " For 'content', do not output the end of content character."); + fll_program_print_help_option(context, fss_extended_write_short_object, fss_extended_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Write an object instead of content."); + fll_program_print_help_option(context, fss_extended_write_short_file, fss_extended_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to."); + fll_program_print_help_option(context, fss_extended_write_short_string, fss_extended_write_long_string, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a string to convert."); + fll_program_print_help_option(context, fss_extended_write_short_partial, fss_extended_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, " For 'content', do not output the end of content character."); - fll_program_print_help_usage(data.context, fss_extended_write_name, ""); + fll_program_print_help_usage(context, fss_extended_write_name, ""); return f_none; } @@ -73,7 +73,7 @@ extern "C" { } if (data->parameters[fss_extended_write_parameter_help].result == f_console_result_found) { - fss_extended_write_print_help(*data); + fss_extended_write_print_help(data->context); } else if (data->parameters[fss_extended_write_parameter_version].result == f_console_result_found) { fll_program_print_version(fss_extended_write_version); diff --git a/level_3/fss_extended_write/c/fss_extended_write.h b/level_3/fss_extended_write/c/fss_extended_write.h index f06918f..02eb2c3 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -110,14 +110,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_fss_extended_write_print_help_ - extern f_return_status fss_extended_write_print_help(const fss_extended_write_data data); + extern f_return_status fss_extended_write_print_help(const fl_color_context context); #endif // _di_fss_extended_write_print_help_ /** diff --git a/level_3/fss_status_code/c/fss_status_code.c b/level_3/fss_status_code/c/fss_status_code.c index c469227..93c6a68 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -6,23 +6,23 @@ extern "C" { #endif #ifndef _di_fss_status_code_print_help_ - f_return_status fss_status_code_print_help(const fss_status_code_data data) { - fll_program_print_help_header(data.context, fss_status_code_name_long, fss_status_code_version); + f_return_status fss_status_code_print_help(const fl_color_context context) { + fll_program_print_help_header(context, fss_status_code_name_long, fss_status_code_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, fss_status_code_short_is_fine, fss_status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is not an error, f_false otherwise."); - fll_program_print_help_option(data.context, fss_status_code_short_is_warning, fss_status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print f_true if the error code is a warning, f_false otherwise."); - fll_program_print_help_option(data.context, fss_status_code_short_is_error, fss_status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is an error, f_false otherwise."); - fll_program_print_help_option(data.context, fss_status_code_short_number, fss_status_code_long_number, f_console_symbol_short_enable, f_console_symbol_long_enable, " Convert status code name to number."); + fll_program_print_help_option(context, fss_status_code_short_is_fine, fss_status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is not an error, f_false otherwise."); + fll_program_print_help_option(context, fss_status_code_short_is_warning, fss_status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print f_true if the error code is a warning, f_false otherwise."); + fll_program_print_help_option(context, fss_status_code_short_is_error, fss_status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is an error, f_false otherwise."); + fll_program_print_help_option(context, fss_status_code_short_number, fss_status_code_long_number, f_console_symbol_short_enable, f_console_symbol_long_enable, " Convert status code name to number."); - fll_program_print_help_usage(data.context, fss_status_code_name, "status code(s)"); + fll_program_print_help_usage(context, fss_status_code_name, "status code(s)"); return f_none; } @@ -49,7 +49,7 @@ extern "C" { status = f_none; if (data->parameters[fss_status_code_parameter_help].result == f_console_result_found) { - fss_status_code_print_help(*data); + fss_status_code_print_help(data->context); fss_status_code_delete_data(data); return f_none; } diff --git a/level_3/fss_status_code/c/fss_status_code.h b/level_3/fss_status_code/c/fss_status_code.h index f000ef1..9cf9eca 100644 --- a/level_3/fss_status_code/c/fss_status_code.h +++ b/level_3/fss_status_code/c/fss_status_code.h @@ -112,14 +112,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_fss_status_code_print_help_ - extern f_return_status fss_status_code_print_help(const fss_status_code_data data); + extern f_return_status fss_status_code_print_help(const fl_color_context context); #endif // _di_fss_status_code_print_help_ /** diff --git a/level_3/init/c/init.c b/level_3/init/c/init.c index 3d2062e..e1f80cf 100644 --- a/level_3/init/c/init.c +++ b/level_3/init/c/init.c @@ -21,22 +21,22 @@ extern "C" { #endif // _di_init_print_version_ #ifndef _di_init_print_help_ - f_return_status init_print_help(const init_data data) { - fll_program_print_help_header(data.context, init_name_long, init_version); + f_return_status init_print_help(const fl_color_context context) { + fll_program_print_help_header(context, init_name_long, init_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - fll_program_print_help_option(data.context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Do not attempt to process kernel command line or perform any boot-time specific preparations."); - fll_program_print_help_option(data.context, init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom run level, ignoring the kernel command line runlevel argument."); + fll_program_print_help_option(context, init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Do not attempt to process kernel command line or perform any boot-time specific preparations."); + fll_program_print_help_option(context, init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom run level, ignoring the kernel command line runlevel argument."); - fll_program_print_help_usage(data.context, init_name, ""); + fll_program_print_help_usage(context, init_name, ""); return f_none; } diff --git a/level_3/init/c/init.h b/level_3/init/c/init.h index 7f1240f..d855ba0 100644 --- a/level_3/init/c/init.h +++ b/level_3/init/c/init.h @@ -279,14 +279,14 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success. */ #ifndef _di_init_print_help_ - extern f_return_status init_print_help(const init_data data); + extern f_return_status init_print_help(const fl_color_context context); #endif // _di_init_print_help_ /** diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index 12ebc84..64008a2 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -6,23 +6,23 @@ extern "C" { #endif #ifndef _di_status_code_print_help_ - f_return_status status_code_print_help(const status_code_data data) { - fll_program_print_help_header(data.context, status_code_name_long, status_code_version); + f_return_status status_code_print_help(const fl_color_context context) { + fll_program_print_help_header(context, status_code_name_long, status_code_version); - fll_program_print_help_option(data.context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(data.context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(data.context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(data.context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); printf("%c", f_string_eol); - fll_program_print_help_option(data.context, status_code_short_is_fine, status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is not an error, f_false otherwise."); - fll_program_print_help_option(data.context, status_code_short_is_warning, status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print f_true if the error code is a warning, f_false otherwise."); - fll_program_print_help_option(data.context, status_code_short_is_error, status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is an error, f_false otherwise."); - fll_program_print_help_option(data.context, status_code_short_number, status_code_long_number, f_console_symbol_short_enable, f_console_symbol_long_enable, " Convert status code name to number."); + fll_program_print_help_option(context, status_code_short_is_fine, status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is not an error, f_false otherwise."); + fll_program_print_help_option(context, status_code_short_is_warning, status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print f_true if the error code is a warning, f_false otherwise."); + fll_program_print_help_option(context, status_code_short_is_error, status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is an error, f_false otherwise."); + fll_program_print_help_option(context, status_code_short_number, status_code_long_number, f_console_symbol_short_enable, f_console_symbol_long_enable, " Convert status code name to number."); - fll_program_print_help_usage(data.context, status_code_name, "status code(s)"); + fll_program_print_help_usage(context, status_code_name, "status code(s)"); return f_none; } @@ -49,7 +49,7 @@ extern "C" { status = f_none; if (data->parameters[status_code_parameter_help].result == f_console_result_found) { - status_code_print_help(*data); + status_code_print_help(data->context); status_code_delete_data(data); return f_none; } diff --git a/level_3/status_code/c/status_code.h b/level_3/status_code/c/status_code.h index e48f2f8..e6e7452 100644 --- a/level_3/status_code/c/status_code.h +++ b/level_3/status_code/c/status_code.h @@ -111,8 +111,8 @@ extern "C" { /** * Print help to standard output. * - * @param data - * The program data. + * @param context + * The color context settings. * * @return * f_none on success.