The (right) parameter prioritization function should be expanded into a left-prioritization and a right-prioritaztion.
Make +q/++quiet and +V/++verbose standard options for verbose.
Add length defines for console standard defines.
Make sure the status return is handled.
There were a few cases where it was not being handled.
Minor code structure cleanups for structural issues I happened to observe.
}
#endif // _di_f_console_parameter_process_
-#ifndef _di_f_console_parameter_prioritize_
- f_return_status f_console_parameter_prioritize(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision) {
+#ifndef _di_f_console_parameter_prioritize_left_
+ f_return_status f_console_parameter_prioritize_left(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision) {
#ifndef _di_level_0_parameter_checking_
if (decision == 0) return f_status_set_error(f_invalid_parameter);
- if (parameters.used == 0) return f_status_set_error(f_invalid_parameter);
if (choices.id == 0) return f_status_set_error(f_invalid_parameter);
- if (choices.used == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
+ if (choices.used == 0) return f_no_data;
+ if (parameters.used == 0) return f_no_data;
+
+ f_array_length location = 0;
+ f_array_length location_sub = 0;
+ f_console_parameter_id priority = 0;
+
+ for (f_array_length i = 0; i < choices.used; i++) {
+ if (choices.id[i] > parameters.used) return f_status_set_error(f_invalid_parameter);
+
+ if (parameters.parameter[choices.id[i]].result == f_console_result_found) {
+ if (parameters.parameter[choices.id[i]].location < location) {
+ location = parameters.parameter[choices.id[i]].location;
+ location_sub = parameters.parameter[choices.id[i]].location_sub;
+ priority = choices.id[i];
+ }
+ else if (parameters.parameter[choices.id[i]].location == location && parameters.parameter[choices.id[i]].location_sub < location_sub) {
+ location_sub = parameters.parameter[choices.id[i]].location_sub;
+ priority = choices.id[i];
+ }
+ }
+ } // for
+
+ // The first parameter location (argc = 0) is the program name, therefore if the location is 0, then no matches were found.
+ if (location == 0) {
+ return f_no_data;
+ }
+
+ *decision = priority;
+
+ return f_none;
+ }
+#endif // _di_f_console_parameter_prioritize_left_
+
+#ifndef _di_f_console_parameter_prioritize_right_
+ f_return_status f_console_parameter_prioritize_right(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision) {
+ #ifndef _di_level_0_parameter_checking_
+ if (decision == 0) return f_status_set_error(f_invalid_parameter);
+ if (choices.id == 0) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (choices.used == 0) return f_no_data;
+ if (parameters.used == 0) return f_no_data;
+
f_array_length location = 0;
f_array_length location_sub = 0;
f_console_parameter_id priority = 0;
return f_none;
}
-#endif // _di_f_console_parameter_prioritize_
+#endif // _di_f_console_parameter_prioritize_right_
#ifdef __cplusplus
} // extern "C"
#endif // _di_f_console_symbols_
/**
- * Create some standard command line parameter options required by the kevux/fss/fll specifications.
+ * Create some standard command line parameter options required/expected by the kevux/fss/fll specifications.
+ *
+ * It is expected that all of the "+" and "++" console options described below are reserved for these purposes.
+ * This is not a strict requirement as such a thing is non-sense in open-source, but this should be considered a strong recommendation.
+ *
+ * It is acceptable for any of these options, when specified multiple times, for that number of times to represent the "level".
+ * For example, a "+D +D" means more debug output than simply "+D".
+ *
+ * The following options are subjective in interpretation but are expected to follow the general interpretation:
+ * - debug: Enable debugging, which will likely increase output verbosity.
+ * - quiet: Decrease verbosity, print less, in some use cases this could mean printing nothing.
+ * - verbose: Increase verbosity, print more, in some use cases this could mean printing just about everything.
+ *
+ * The following are less subjective in interpretation but do allow some flexibility.
+ * - dark: Do display color intended for dark backgrounds (often the default behavior) when printing to the console. Other contexts may be acceptable (such as voice inflections, or lack-thereof) for audio.)
+ * - help: Display the help text. This does not define how the text is displayed only that the text is displayed.
+ * - light: Do display color intended for light backgrounds when printing to the console. Other contexts may be acceptable (such as voice inflections, or lack-thereof) for audio.)
+ * - no_color: Do not display color when printing to the console. Other contexts may be acceptable (such as voice inflections, or lack-thereof) for audio.)
+ * - version: Should always print only the version number, no colors, but what represents the version number is undefined by this project.
*/
#ifndef _di_f_standard_console_parameters_
#define f_console_standard_short_dark "d"
#define f_console_standard_short_help "h"
#define f_console_standard_short_light "l"
#define f_console_standard_short_no_color "n"
+ #define f_console_standard_short_quiet "q"
+ #define f_console_standard_short_verbose "V"
#define f_console_standard_short_version "v"
+ #define f_console_standard_short_dark_length 1
+ #define f_console_standard_short_debug_length 1
+ #define f_console_standard_short_help_length 1
+ #define f_console_standard_short_light_length 1
+ #define f_console_standard_short_no_color_length 1
+ #define f_console_standard_short_quiet_length 1
+ #define f_console_standard_short_verbose_length 1
+ #define f_console_standard_short_version_length 1
+
#define f_console_standard_long_dark "dark"
#define f_console_standard_long_debug "debug"
#define f_console_standard_long_help "help"
#define f_console_standard_long_light "light"
#define f_console_standard_long_no_color "no_color"
+ #define f_console_standard_long_quiet "quiet"
+ #define f_console_standard_long_verbose "verbose"
#define f_console_standard_long_version "version"
+
+ #define f_console_standard_long_dark_length 4
+ #define f_console_standard_long_debug_length 5
+ #define f_console_standard_long_help_length 4
+ #define f_console_standard_long_light_length 5
+ #define f_console_standard_long_no_color_length 8
+ #define f_console_standard_long_quiet_length 5
+ #define f_console_standard_long_verbose_length 7
+ #define f_console_standard_long_version_length 7
#endif // _di_f_standard_console_parameters_
/**
* Given a set of parameter choices, determine which one has the highest priority.
*
* The priority is determined by viewing the parameters from left to right.
+ * The left-most parameter defined in the set has the priority over others.
+ *
+ * For example, the color context modes override each other, so only one gets priority.
+ * If given, say "+l ++no_color +d", the "+d" would be the left-most parameter "+l" and "++no_color".
+ * The decision would be "+d".
+ *
+ * This also applies to short parameters combined into one, such as "+lnd", the "d" would again be the decision.
+ *
+ * @param parameters
+ * The parameters to process.
+ * @param choices
+ * An array of numeric ids, each representing a parameter within the parameters variable.
+ * The order does not matter.
+ * @param decision
+ * The resulting decision.
+ * If none of the parameters are found, then this will not be updated (therefore it is safe to have it pre-initialized to the default).
+ *
+ * @return
+ * f_none on success.
+ * f_no_data if no parameters were found.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_f_console_parameter_prioritize_left_
+ extern f_return_status f_console_parameter_prioritize_left(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision);
+#endif // _di_f_console_parameter_prioritize_left_
+
+/**
+ * Given a set of parameter choices, determine which one has the highest priority.
+ *
+ * The priority is determined by viewing the parameters from left to right.
* The right-most parameter defined in the set has the priority over others.
*
* For example, the color context modes override each other, so only one gets priority.
* f_no_data if no parameters were found.
* f_invalid_parameter (with error bit) if a parameter is invalid.
*/
-#ifndef _di_f_console_parameter_prioritize_
- extern f_return_status f_console_parameter_prioritize(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision);
-#endif // _di_f_console_parameter_prioritize_
+#ifndef _di_f_console_parameter_prioritize_right_
+ extern f_return_status f_console_parameter_prioritize_right(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision);
+#endif // _di_f_console_parameter_prioritize_right_
#ifdef __cplusplus
} // extern "C"
#endif // _di_fll_program_print_version_
#ifndef _di_fll_program_parameter_process_
- f_return_status fll_program_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, f_string_lengths *remaining, fl_color_context *context) {
+ f_return_status fll_program_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context) {
f_status status = f_none;
status = f_console_parameter_process(arguments, parameters, remaining);
- f_console_parameter_id decision = choices.id[2];
-
- f_console_parameter_prioritize(parameters, choices, &decision);
-
- // load colors unless told not to.
- if (decision != choices.id[0]) {
- f_status allocation_status = f_none;
-
- fl_macro_color_context_new(allocation_status, (*context));
-
- if (f_status_is_error(allocation_status)) {
- fprintf(f_standard_error, "CRITICAL ERROR: Unable to allocate memory.\n");
- return allocation_status;
- }
-
- fl_color_load_context(context, decision == choices.id[1]);
- }
-
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_no_data) {
fl_color_print_line(f_standard_error, context->error, context->reset, "ERROR: One of the parameters you passed requires an additional parameter that you did not pass.");
- // TODO: there is a way to identify which parameter is incorrect
+ // @todo there is a way to identify which parameter is incorrect
// to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
// nothing can be 0 as that represents the program name, unless argv[] is improperly created
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print(f_standard_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling ");
+ fl_color_print(f_standard_error, context->notable, context->reset, "f_console_parameter_process");
+ fl_color_print_line(f_standard_error, context->error, context->reset, ").");
}
else if (status == f_invalid_utf) {
fl_color_print(f_standard_error, context->error, context->reset, "ENCODING ERROR: Invalid UTF-8 character in parameter when calling ");
return f_status_set_error(status);
}
+ f_console_parameter_id decision = choices.id[2];
+
+ f_string function;
+
+ if (right) {
+ function = "f_console_parameter_prioritize_right";
+ status = f_console_parameter_prioritize_right(parameters, choices, &decision);
+ }
+ else {
+ function = "f_console_parameter_prioritize_left";
+ status = f_console_parameter_prioritize_left(parameters, choices, &decision);
+ }
+
+ if (f_status_is_error(status)) {
+ status = f_status_set_fine(status);
+
+ if (status == f_error_allocation || status == f_error_reallocation) {
+ fl_color_print(f_standard_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling ");
+ fl_color_print(f_standard_error, context->notable, context->reset, "%s", function);
+ fl_color_print_line(f_standard_error, context->error, context->reset, ").");
+ }
+ else if (status == f_invalid_parameter) {
+ fl_color_print(f_standard_error, context->error, context->reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_standard_error, context->notable, context->reset, "%s", function);
+ fl_color_print_line(f_standard_error, context->error, context->reset, "().");
+ }
+ else {
+ fl_color_print(f_standard_error, context->error, context->reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_standard_error, context->notable, context->reset, "%u", status);
+ fl_color_print(f_standard_error, context->error, context->reset, ") has occurred while calling ");
+ fl_color_print(f_standard_error, context->notable, context->reset, "%s", function);
+ fl_color_print_line(f_standard_error, context->error, context->reset, "().");
+ }
+
+ return f_status_set_error(status);
+ }
+
+ // load colors unless told not to.
+ if (decision != choices.id[0]) {
+ f_status allocation_status = f_none;
+
+ fl_macro_color_context_new(allocation_status, (*context));
+
+ if (f_status_is_error(allocation_status)) {
+ fl_color_print(f_standard_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling ");
+ fl_color_print(f_standard_error, context->notable, context->reset, "fl_macro_color_context_new");
+ fl_color_print_line(f_standard_error, context->error, context->reset, "().");
+
+ return allocation_status;
+ }
+
+ status = fl_color_load_context(context, decision == choices.id[1]);
+ }
+
return status;
}
#endif // _di_fll_program_parameter_process_
+#ifndef _di_fll_program_parameter_process_quietly_
+ f_return_status fll_program_parameter_process_quietly(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context) {
+ f_status status = f_none;
+
+ status = f_console_parameter_process(arguments, parameters, remaining);
+
+ if (f_status_is_error(status)) return status;
+
+ f_console_parameter_id decision = choices.id[2];
+
+ if (right) {
+ status = f_console_parameter_prioritize_right(parameters, choices, &decision);
+ }
+ else {
+ status = f_console_parameter_prioritize_left(parameters, choices, &decision);
+ }
+
+ if (f_status_is_error(status)) return status;
+
+ // load colors unless told not to.
+ if (decision != choices.id[0]) {
+ f_status allocation_status = f_none;
+
+ fl_macro_color_context_new(allocation_status, (*context));
+
+ if (f_status_is_error(allocation_status)) return allocation_status;
+
+ status = fl_color_load_context(context, decision == choices.id[1]);
+ }
+
+ return status;
+ }
+#endif // _di_fll_program_parameter_process_quietly_
+
#ifndef _di_fll_program_parameter_additional_append_
f_return_status fll_program_parameter_additional_append(const f_string *argv, const f_string_lengths additional, f_string_dynamics *destination) {
#ifndef _di_level_2_parameter_checking_
* @param choices
* A set of the color options: no-color option, light-color option, dark-color option.
* This must have its used size set to 3 and the ids are expected to be in this order: no_color, light, and dark.
+ * @param right
+ * Set to TRUE for right priortization and FALSE for left prioritization.
* @param remaining
* A list of remaining parameters not associated with anything.
* @param context
* f_error_reallocation (with error bit) on memory reallocation error.
*/
#ifndef _di_fll_program_parameter_process_
- extern f_return_status fll_program_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, f_string_lengths *remaining, fl_color_context *context);
+ extern f_return_status fll_program_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context);
#endif // _di_fll_program_parameter_process_
+/**
+ * Perform basic parameter loading, including initialization of color context but does not print errors.
+ *
+ * @param arguments
+ * The parameters passed to the process.
+ * @param parameters
+ * The console parameters to look for.
+ * @param choices
+ * A set of the color options: no-color option, light-color option, dark-color option.
+ * This must have its used size set to 3 and the ids are expected to be in this order: no_color, light, and dark.
+ * @param right
+ * Set to TRUE for right priortization and FALSE for left prioritization.
+ * @param remaining
+ * A list of remaining parameters not associated with anything.
+ * @param context
+ * The color context.
+ *
+ * @return
+ * f_none on success.
+ * f_no_data if "additional" parameters were expected but not found.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_error_reallocation (with error bit) on memory reallocation error.
+ */
+#ifndef _di_fll_program_parameter_process_quietly_
+ extern f_return_status fll_program_parameter_process_quietly(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context);
+#endif // _di_fll_program_parameter_process_quietly_
/**
* Allocate new strings from all of the provided locations.
choices.id = ids;
choices.used = 3;
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
if (f_status_is_error(status)) {
byte_dump_delete_data(data);
return f_status_set_error(status);
}
+
+ status = f_none;
}
// Identify priority of mode parameters.
choices.id = ids;
choices.used = 5;
- status = f_console_parameter_prioritize(parameters, choices, &choice);
+ status = f_console_parameter_prioritize_right(parameters, choices, &choice);
if (f_status_is_error(status)) {
byte_dump_delete_data(data);
choices.id = ids;
choices.used = 3;
- status = f_console_parameter_prioritize(parameters, choices, &choice);
+ status = f_console_parameter_prioritize_right(parameters, choices, &choice);
if (f_status_is_error(status)) {
byte_dump_delete_data(data);
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_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
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);
choices.id = ids;
choices.used = 3;
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
if (f_status_is_error(status)) {
fake_delete_data(data);
return f_status_set_error(status);
}
+
+ status = f_none;
}
// Determine order of operations.
fake_parameter_help,
fake_parameter_light,
fake_parameter_dark,
+ fake_parameter_debug,
fake_parameter_no_color,
+ fake_parameter_quiet,
+ fake_parameter_verbose,
fake_parameter_version,
fake_parameter_defines,
f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, 0, f_console_type_normal), \
f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, 0, f_console_type_inverse), \
f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, 0, f_console_type_inverse), \
+ f_console_parameter_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, 0, f_console_type_inverse), \
f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, 0, f_console_type_inverse), \
+ f_console_parameter_initialize(f_console_standard_short_quiet, f_console_standard_long_quiet, 0, 0, f_console_type_inverse), \
+ f_console_parameter_initialize(f_console_standard_short_verbose, f_console_standard_long_verbose, 0, 0, f_console_type_inverse), \
f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \
f_console_parameter_initialize(fake_short_defines, fake_long_defines, 0, 1, f_console_type_normal), \
f_console_parameter_initialize(fake_short_mode, fake_long_mode, 0, 1, f_console_type_normal), \
f_console_parameter_initialize(0, 0, fake_other_operation_skeleton, 0, f_console_type_other), \
}
- #define fake_total_parameters 28
+ #define fake_total_parameters 31
#endif // _di_fake_defines_
#ifndef _di_fake_data_
-# fss-0000
+# fss-0001
project_name fake
project_level 3
f_console_parameter_id ids[3] = { firewall_parameter_no_color, firewall_parameter_light, firewall_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
- }
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
- if (f_status_is_error(status)) {
- firewall_delete_data(data);
- return f_status_set_error(status);
- }
+ if (f_status_is_error(status)) {
+ firewall_delete_data(data);
+ return f_status_set_error(status);
+ }
- status = f_none;
+ status = f_none;
+ }
if (data->parameters[firewall_parameter_help].result == f_console_result_found) {
firewall_print_help(data->context);
f_console_parameter_id ids[3] = { fss_basic_list_read_parameter_no_color, fss_basic_list_read_parameter_light, fss_basic_list_read_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
if (f_status_is_error(status)) {
fss_basic_list_read_delete_data(data);
f_console_parameter_id ids[3] = { fss_basic_list_write_parameter_no_color, fss_basic_list_write_parameter_light, fss_basic_list_write_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
- }
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
- if (f_status_is_error(status)) {
- fss_basic_list_write_delete_data(data);
- return f_status_set_error(status);
- }
+ if (f_status_is_error(status)) {
+ fss_basic_list_write_delete_data(data);
+ return f_status_set_error(status);
+ }
- status = f_none;
+ status = f_none;
+ }
if (data->parameters[fss_basic_list_write_parameter_help].result == f_console_result_found) {
fss_basic_list_write_print_help(data->context);
f_console_parameter_id ids[3] = { fss_basic_read_parameter_no_color, fss_basic_read_parameter_light, fss_basic_read_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
if (f_status_is_error(status)) {
fss_basic_read_delete_data(data);
f_console_parameter_id ids[3] = { fss_basic_write_parameter_no_color, fss_basic_write_parameter_light, fss_basic_write_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
- }
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
- if (f_status_is_error(status)) {
- fss_basic_write_delete_data(data);
- return f_status_set_error(status);
- }
+ if (f_status_is_error(status)) {
+ fss_basic_write_delete_data(data);
+ return f_status_set_error(status);
+ }
- status = f_none;
+ status = f_none;
+ }
if (data->parameters[fss_basic_write_parameter_help].result == f_console_result_found) {
fss_basic_write_print_help(data->context);
f_console_parameter_id ids[3] = { fss_extended_list_read_parameter_no_color, fss_extended_list_read_parameter_light, fss_extended_list_read_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
if (f_status_is_error(status)) {
fss_extended_list_read_delete_data(data);
f_console_parameter_id ids[3] = { fss_extended_read_parameter_no_color, fss_extended_read_parameter_light, fss_extended_read_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
if (f_status_is_error(status)) {
fss_extended_read_delete_data(data);
f_console_parameter_id ids[3] = { fss_extended_write_parameter_no_color, fss_extended_write_parameter_light, fss_extended_write_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
- }
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
- if (f_status_is_error(status)) {
- fss_extended_write_delete_data(data);
- return f_status_set_error(status);
- }
+ if (f_status_is_error(status)) {
+ fss_extended_write_delete_data(data);
+ return f_status_set_error(status);
+ }
- status = f_none;
+ status = f_none;
+ }
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
f_console_parameter_id ids[3] = { fss_status_code_parameter_no_color, fss_status_code_parameter_light, fss_status_code_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
- }
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
- if (f_status_is_error(status)) {
- fss_status_code_delete_data(data);
- return f_status_set_error(status);
- }
+ if (f_status_is_error(status)) {
+ fss_status_code_delete_data(data);
+ return f_status_set_error(status);
+ }
- f_status status2 = f_none;
- status = f_none;
+ status = f_none;
+ }
if (data->parameters[fss_status_code_parameter_help].result == f_console_result_found) {
fss_status_code_print_help(data->context);
return f_status_set_error(f_invalid_parameter);
}
+ f_status status2 = f_none;
+
if (data->parameters[fss_status_code_parameter_is_error].result == f_console_result_found || data->parameters[fss_status_code_parameter_is_warning].result == f_console_result_found || data->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) {
if (data->process_pipe) {
// @todo: call fss_status_code_process_check() here for all data from pipe that is space separated.
f_console_parameter_id ids[3] = { init_parameter_no_color, init_parameter_light, init_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
- }
-
- if (f_status_is_error(status)) {
- // @todo: init_delete_data(data);
- return f_status_set_error(status);
- }
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
- status = f_none;
+ if (f_status_is_error(status)) {
+ // @todo: init_delete_data(data);
+ return f_status_set_error(status);
+ }
+ status = f_none;
+ }
if (data->parameters[init_parameter_runlevel].result == f_console_result_found) {
const unsigned int parameter_length = strlen(arguments.argv[data->parameters[init_parameter_runlevel].additional.array[0]]);
f_console_parameter_id ids[3] = { status_code_parameter_no_color, status_code_parameter_light, status_code_parameter_dark };
f_console_parameter_ids choices = { ids, 3 };
- status = fll_program_parameter_process(arguments, parameters, choices, &data->remaining, &data->context);
- }
+ status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context);
- if (f_status_is_error(status)) {
- status_code_delete_data(data);
- return f_status_set_error(status);
- }
+ if (f_status_is_error(status)) {
+ status_code_delete_data(data);
+ return f_status_set_error(status);
+ }
- f_status status2 = f_none;
- status = f_none;
+ status = f_none;
+ }
if (data->parameters[status_code_parameter_help].result == f_console_result_found) {
status_code_print_help(data->context);
return f_status_set_error(f_invalid_parameter);
}
+ f_status status2 = f_none;
+
if (data->parameters[status_code_parameter_is_error].result == f_console_result_found || data->parameters[status_code_parameter_is_warning].result == f_console_result_found || data->parameters[status_code_parameter_is_fine].result == f_console_result_found) {
if (data->process_pipe) {
// @todo: call status_code_process_check() here for all data from pipe that is space separated.