From: Kevin Day Date: Sat, 19 Sep 2020 04:24:27 +0000 (-0500) Subject: Bugfix: iki_write needs to handle the error cases where -o/--object and -c/--content... X-Git-Tag: 0.5.1~82 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=472214316abd997589249df604503270b6174f58;p=fll Bugfix: iki_write needs to handle the error cases where -o/--object and -c/--content do not have parameters. The -o/--object and -c/--content parameters both require an additional parameter. If that additional parameter is missing, then error out. --- diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index f9ee15c..0dc541f 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -144,6 +144,26 @@ extern "C" { } } + if (F_status_is_fine(status) && data->parameters[iki_write_parameter_object].result == f_console_result_found) { + if (data->verbosity != iki_write_verbosity_quiet) { + fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_write_long_object); + fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); + } + + status = F_status_set_error(F_parameter); + } + + if (F_status_is_fine(status) && data->parameters[iki_write_parameter_content].result == f_console_result_found) { + if (data->verbosity != iki_write_verbosity_quiet) { + fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_write_long_content); + fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); + } + + status = F_status_set_error(F_parameter); + } + if (F_status_is_fine(status) && !data->process_pipe) { if (data->parameters[iki_write_parameter_object].result != f_console_result_additional && data->parameters[iki_write_parameter_content].result != f_console_result_additional) { if (data->verbosity != iki_write_verbosity_quiet) {