From e2deb5ad64f82bc6a3813af52740b083c244911c Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 25 Apr 2020 22:30:19 -0500 Subject: [PATCH] Feature: add "other" parameter support in program print Printing support for short and long options exist but I never created one for other option. --- level_2/fll_program/c/program.c | 11 +++++++++++ level_2/fll_program/c/program.h | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index d6365e7..d65ece3 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -44,6 +44,17 @@ extern "C" { } #endif // _di_fll_program_print_help_option_long_ +#ifndef _di_fll_program_print_help_option_other_ + f_return_status fll_program_print_help_option_other(const fl_color_context context, const f_string option_other, const f_string description) { + printf("%c ", f_string_eol); + fl_color_print(f_standard_output, context.standout, context.reset, option_other); + + printf(" %s", description); + + return f_none; + } +#endif // _di_fll_program_print_help_option_other_ + #ifndef _di_fll_program_print_help_usage_ f_return_status fll_program_print_help_usage(const fl_color_context context, const f_string name, const f_string parameters) { printf("%c%c", f_string_eol, f_string_eol); diff --git a/level_2/fll_program/c/program.h b/level_2/fll_program/c/program.h index 49bdd8a..e445d43 100644 --- a/level_2/fll_program/c/program.h +++ b/level_2/fll_program/c/program.h @@ -86,6 +86,23 @@ extern "C" { #endif // _di_fll_program_print_help_option_long_ /** + * Print standard help option (other option only). + * + * @param context + * The color context. + * @param option_other + * The other name of the option. + * @param description + * A desciption associated with the option. + * + * @return + * f_none on success. + */ +#ifndef _di_fll_program_print_help_option_other_ + extern f_return_status fll_program_print_help_option_other(const fl_color_context context, const f_string option_other, const f_string description); +#endif // _di_fll_program_print_help_option_other_ + +/** * Print standard help usage. * * @param context -- 1.8.3.1