]> Kevux Git Server - fll/commitdiff
Progress: Continue program related work, updating fss_write.
authorKevin Day <thekevinday@gmail.com>
Wed, 30 Nov 2022 04:59:01 +0000 (22:59 -0600)
committerKevin Day <thekevinday@gmail.com>
Wed, 30 Nov 2022 04:59:01 +0000 (22:59 -0600)
Relocate help and version flag assignment checks across programs.

Setup individual help printing for each supported "--as" parameter in fss_write.

51 files changed:
level_3/byte_dump/c/common.c
level_3/control/c/common.c
level_3/controller/c/common.c
level_3/fake/c/common.c
level_3/firewall/c/common.c
level_3/fss_basic_list_read/c/common.c
level_3/fss_basic_list_write/c/common.c
level_3/fss_basic_read/c/common.c
level_3/fss_basic_write/c/common.c
level_3/fss_embedded_list_read/c/common.c
level_3/fss_embedded_list_write/c/common.c
level_3/fss_extended_list_read/c/common.c
level_3/fss_extended_list_write/c/common.c
level_3/fss_extended_read/c/common.c
level_3/fss_extended_write/c/common.c
level_3/fss_identify/c/common.c
level_3/fss_payload_read/c/common.c
level_3/fss_payload_write/c/common.c
level_3/fss_write/c/basic/common.c
level_3/fss_write/c/basic/common.h
level_3/fss_write/c/basic/main.c
level_3/fss_write/c/basic/print.c
level_3/fss_write/c/basic_list/common.c
level_3/fss_write/c/basic_list/common.h
level_3/fss_write/c/basic_list/main.c
level_3/fss_write/c/basic_list/print.c
level_3/fss_write/c/embedded_list/common.c
level_3/fss_write/c/embedded_list/common.h
level_3/fss_write/c/embedded_list/main.c
level_3/fss_write/c/embedded_list/print.c
level_3/fss_write/c/extended/common.c
level_3/fss_write/c/extended/common.h
level_3/fss_write/c/extended/main.c
level_3/fss_write/c/extended/print.c
level_3/fss_write/c/extended_list/common.c
level_3/fss_write/c/extended_list/common.h
level_3/fss_write/c/extended_list/main.c
level_3/fss_write/c/extended_list/print.c
level_3/fss_write/c/main/common.c
level_3/fss_write/c/main/common.h
level_3/fss_write/c/main/main.c
level_3/fss_write/c/main/main.h
level_3/fss_write/c/main/print.c
level_3/fss_write/c/main/print.h
level_3/fss_write/c/payload/common.c
level_3/fss_write/c/payload/common.h
level_3/fss_write/c/payload/main.c
level_3/fss_write/c/payload/print.c
level_3/iki_read/c/iki_read.c
level_3/iki_write/c/common.c
level_3/utf8/c/common.c

index b85f53f75f95e2e810147baef4d086940867e937..c6bc7fd5929a4c33e33d278a73e460a239ad331e 100644 (file)
@@ -149,24 +149,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[byte_dump_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= byte_dump_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[byte_dump_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= byte_dump_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[byte_dump_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= byte_dump_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[byte_dump_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= byte_dump_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[byte_dump_parameter_strip_invalid_e].result & f_console_result_found_e) {
index 1e6d4f5e8f8918f20cdad746b9e7c90708965c9c..f4c9d6655e6f80138d2806d0bf19d1fe52ace20c 100644 (file)
@@ -252,24 +252,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[control_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= control_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[control_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= control_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[control_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= control_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[control_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= control_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[control_parameter_strip_invalid_e].result & f_console_result_found_e) {
index 158e265a729873bc890895f0e14637c17b049261..4389cfe35b8adbf79d9362bd61e0d74029056228 100644 (file)
@@ -684,24 +684,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[controller_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= controller_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[controller_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= controller_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[controller_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= controller_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[controller_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= controller_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[controller_parameter_strip_invalid_e].result & f_console_result_found_e) {
index acbb147d0baf641a92dcc17db6d8460d340148ee..19f7e72601d8805d78a9a976b764e9452e12db8f 100644 (file)
@@ -197,24 +197,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fake_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fake_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fake_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fake_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fake_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fake_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fake_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fake_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fake_parameter_strip_invalid_e].result & f_console_result_found_e) {
index a3f2d79ea5f2ff960720a67aa683111f1700886b..1d16175dc7e80d0e06f2c840012c51d6f586f931 100644 (file)
@@ -185,24 +185,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[firewall_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= firewall_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[firewall_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= firewall_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[firewall_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= firewall_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[firewall_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= firewall_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[firewall_parameter_strip_invalid_e].result & f_console_result_found_e) {
index 87f82c85bfaad4c890c1780ed888d083e7368e20..66bea4bff78112f6b7a84292cf1809cb07628273 100644 (file)
@@ -143,24 +143,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_basic_list_read_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_basic_list_read_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_basic_list_read_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_basic_list_read_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_basic_list_read_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_basic_list_read_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_basic_list_read_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_basic_list_read_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_basic_list_read_parameter_strip_invalid_e].result & f_console_result_found_e) {
index 418f7ecc81165d4d1201b3d96a36e7ce995b66fa..7f7a0f38ef04715842bc198a9235c1c571fb4064 100644 (file)
@@ -124,24 +124,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_basic_list_write_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_basic_list_write_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_basic_list_write_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_basic_list_write_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_basic_list_write_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_basic_list_write_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_basic_list_write_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_basic_list_write_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_basic_list_write_parameter_strip_invalid_e].result & f_console_result_found_e) {
index 1236c9bf5a1c506fac778bfd585aff6937349ee2..0ae32138c65d04a7f26a9f3ff9bb60769d6491e5 100644 (file)
@@ -142,24 +142,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_basic_read_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_basic_read_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_basic_read_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_basic_read_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_basic_read_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_basic_read_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_basic_read_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_basic_read_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_basic_read_parameter_strip_invalid_e].result & f_console_result_found_e) {
index f00eaee38d0209b1e0fbdc3d3cbecdcb420dd0fa..f98f67d376ad522700f2c83ec1e61cdae7f4cfb0 100644 (file)
@@ -124,24 +124,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_basic_write_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_basic_write_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_basic_write_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_basic_write_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_basic_write_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_basic_write_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_basic_write_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_basic_write_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_basic_write_parameter_strip_invalid_e].result & f_console_result_found_e) {
index ef4fcff2e5b465b9f8a52af364da9e269d72a198..317a7996bf512f09fdb73357cf0b8fbf33fe8b9d 100644 (file)
@@ -141,24 +141,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_embedded_list_read_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_embedded_list_read_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_embedded_list_read_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_embedded_list_read_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_embedded_list_read_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_embedded_list_read_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_embedded_list_read_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_embedded_list_read_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_embedded_list_read_parameter_strip_invalid_e].result & f_console_result_found_e) {
index a464a7e3d66325b3d503150d072b91f44dae8eab..88b47bc2a1b48bb278e6fee2ebfd4ba5cc503940 100644 (file)
@@ -124,24 +124,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_embedded_list_write_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_embedded_list_write_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_embedded_list_write_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_embedded_list_write_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_embedded_list_write_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_embedded_list_write_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_embedded_list_write_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_embedded_list_write_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_embedded_list_write_parameter_strip_invalid_e].result & f_console_result_found_e) {
index 43bb49119da1da2b3b09fc896c0ea1d06c369a34..8e7ab597ed49682a7d06225083729ee3a3a0a553 100644 (file)
@@ -149,24 +149,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_extended_list_read_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_extended_list_read_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_extended_list_read_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_extended_list_read_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_extended_list_read_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_extended_list_read_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_extended_list_read_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_extended_list_read_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_extended_list_read_parameter_strip_invalid_e].result & f_console_result_found_e) {
index dcb25d47fbfb2be45d6c50b0967abf2ddcd08ad8..d4c4df5f798bae097d4140f5ebcbc3a917a2f90b 100644 (file)
@@ -131,24 +131,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_extended_list_write_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_extended_list_write_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_extended_list_write_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_extended_list_write_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_extended_list_write_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_extended_list_write_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_extended_list_write_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_extended_list_write_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_extended_list_write_parameter_strip_invalid_e].result & f_console_result_found_e) {
index ba3abde6cd05129c94949b040f435a6f10483b11..9b44d528c72dd93b6b0740c2835404dacfe2a54c 100644 (file)
@@ -142,24 +142,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_extended_read_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_extended_read_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_extended_read_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_extended_read_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_extended_read_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_extended_read_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_extended_read_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_extended_read_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_extended_read_parameter_strip_invalid_e].result & f_console_result_found_e) {
index 389a3516e795b472b90cac802933f3ecbe5a0f8f..e85733efdea1237f1c0d03163448c9c00d0d14fc 100644 (file)
@@ -124,24 +124,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_extended_write_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_extended_write_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_extended_write_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_extended_write_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_extended_write_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_extended_write_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_extended_write_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_extended_write_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_extended_write_parameter_strip_invalid_e].result & f_console_result_found_e) {
index c932d9c423d27eb26d3b5041d20494c3d5e7f9b7..ea366be47455200322106c38906cde37fcb4a86f 100644 (file)
@@ -109,24 +109,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_identify_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_identify_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_identify_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_identify_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_identify_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_identify_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_identify_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_identify_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_identify_parameter_strip_invalid_e].result & f_console_result_found_e) {
index 4a537f95643df729d1e76585964b659c029a11ae..e89088b1e5d0a52e3eebeeb7a892bb1d0094c822 100644 (file)
@@ -143,24 +143,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_payload_read_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_payload_read_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_payload_read_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_payload_read_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_payload_read_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_payload_read_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_payload_read_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_payload_read_main_flag_version_e;
+
+      return;
+    }
+
     f_string_static_t * const args = main->parameters.arguments.array;
 
     if (main->parameters.array[fss_payload_read_parameter_strip_invalid_e].result & f_console_result_found_e) {
index 59bb9851a3d067e5cd2e108c6e5455a1280d3a1c..1dfcb4e4f36aaa53eea8b861e640d45703c646f8 100644 (file)
@@ -132,24 +132,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_payload_write_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_payload_write_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_payload_write_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_payload_write_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[fss_payload_write_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_payload_write_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[fss_payload_write_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_payload_write_main_flag_version_e;
+
+      return;
+    }
+
     if (main->parameters.array[fss_payload_write_parameter_file_e].result & f_console_result_value_e && main->parameters.array[fss_payload_write_parameter_file_e].values.used) {
       if (main->parameters.array[fss_payload_write_parameter_file_e].values.used > 1) {
         setting->status = F_status_set_error(F_parameter);
index f6993c76b6147b291017394627d4d3441947215c..78d096b409d97866f8f5f822916b4852f5a81cd3 100644 (file)
@@ -7,6 +7,9 @@ extern "C" {
 #ifndef _di_fss_write_basic_strings_
   const f_string_static_t fss_write_basic_standard_s = macro_f_string_static_t_initialize(FSS_WRITE_basic_standard_s, 0, FSS_WRITE_basic_standard_s_length);
 
+  const f_string_static_t fss_write_basic_program_name_s = macro_f_string_static_t_initialize(FSS_WRITE_basic_program_name_s, 0, FSS_WRITE_basic_program_name_s_length);
+  const f_string_static_t fss_write_basic_program_name_long_s = macro_f_string_static_t_initialize(FSS_WRITE_basic_program_name_long_s, 0, FSS_WRITE_basic_program_name_long_s_length);
+
   const f_string_static_t fss_write_format_code_short_0000_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_short_0000_s, 0, FSS_WRITE_format_code_short_0000_s_length);
   const f_string_static_t fss_write_format_code_long_0000_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_long_0000_s, 0, FSS_WRITE_format_code_long_0000_s_length);
   const f_string_static_t fss_write_format_code_human_0000_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_human_0000_s, 0, FSS_WRITE_format_code_human_0000_s_length);
index de6135e11ece629d8d41d2024cc4588312d21f8b..b796ef915660a50408080a103603b545b2179f4c 100644 (file)
@@ -22,18 +22,27 @@ extern "C" {
 #ifndef _di_fss_write_basic_strings_
   #define FSS_WRITE_basic_standard_s "FSS-0000 (Basic)"
 
+  #define FSS_WRITE_basic_program_name_s      "fss_basic_write"
+  #define FSS_WRITE_basic_program_name_long_s "FSS Basic Write"
+
   #define FSS_WRITE_format_code_short_0000_s "0000"
   #define FSS_WRITE_format_code_long_0000_s  "fss-0000"
   #define FSS_WRITE_format_code_human_0000_s "basic"
 
   #define FSS_WRITE_basic_standard_s_length 16
 
+  #define FSS_WRITE_basic_program_name_s_length      15
+  #define FSS_WRITE_basic_program_name_long_s_length 15
+
   #define FSS_WRITE_format_code_short_0000_s_length 4
   #define FSS_WRITE_format_code_long_0000_s_length  8
   #define FSS_WRITE_format_code_human_0000_s_length 5
 
   extern const f_string_static_t fss_write_basic_standard_s;
 
+  extern const f_string_static_t fss_write_basic_program_name_s;
+  extern const f_string_static_t fss_write_basic_program_name_long_s;
+
   extern const f_string_static_t fss_write_format_code_short_0000_s;
   extern const f_string_static_t fss_write_format_code_long_0000_s;
   extern const f_string_static_t fss_write_format_code_human_0000_s;
index 8b9a9e8dfa4de5838a9be9c0d37ecbd8cad68dea..2b95e0cbb91f5b353c0e05bbe84bdb0056b2ee94 100644 (file)
@@ -8,6 +8,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.process_help = &fss_write_basic_process_help;
   setting.process_pipe = &fss_write_basic_process_pipe;
   setting.process_normal = &fss_write_basic_process_normal;
+  setting.program_name = &fss_write_basic_program_name_s;
+  setting.program_name_long = &fss_write_basic_program_name_long_s;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -24,7 +26,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, &data, &setting);
+    fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
   fss_write_basic_main(&data, &setting);
index bc34f6bf24efc377bdd3c02839010051bf764535..75ff0f7a3abf3b1148fe7245209f6c8769d22cfb 100644 (file)
@@ -12,15 +12,21 @@ extern "C" {
 
     f_print_dynamic_raw(setting->line_first, print.to);
 
-    fll_program_print_help_header(print, fss_write_program_name_long_s, fss_write_program_version_s);
+    fll_program_print_help_header(print, setting->program_name_long ? *setting->program_name_long : fss_write_program_name_long_s, fss_write_program_version_s);
 
     fss_write_print_help(setting, print);
 
     f_print_dynamic_raw(f_string_eol_s, print.to);
 
-    fll_program_print_help_usage(print, fss_write_program_name_s, f_string_empty_s);
+    fll_program_print_help_usage(print, setting->program_name ? *setting->program_name : fss_write_program_name_s, f_string_empty_s);
 
-    // @todo
+    fss_write_print_help_pipe(setting, print);
+
+    fl_print_format("%r  The FSS-0000 (Basic) specification does not support multi-line Content, therefore the parameter '%[%r%r%]'", print.to, f_string_eol_s, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_prepend_s, print.set->notable);
+    fl_print_format(" does nothing.%r%r", print.to, f_string_eol_s, f_string_eol_s);
+
+    fl_print_format("  This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_ignore_s, print.set->notable, f_string_eol_s);
+    fl_print_format("  This parameter requires two values.%r", print.to, f_string_eol_s);
 
     f_print_dynamic_raw(setting->line_last, print.to);
 
index 477f698ba8fb587419c56d283217a70dfe814eab..4271316a096be95e255663886a0c792dcd0a0931 100644 (file)
@@ -7,6 +7,9 @@ extern "C" {
 #ifndef _di_fss_write_basic_list_strings_
   const f_string_static_t fss_write_basic_list_standard_s = macro_f_string_static_t_initialize(FSS_WRITE_basic_list_standard_s, 0, FSS_WRITE_basic_list_standard_s_length);
 
+  const f_string_static_t fss_write_basic_list_program_name_s = macro_f_string_static_t_initialize(FSS_WRITE_basic_list_program_name_s, 0, FSS_WRITE_basic_list_program_name_s_length);
+  const f_string_static_t fss_write_basic_list_program_name_long_s = macro_f_string_static_t_initialize(FSS_WRITE_basic_list_program_name_long_s, 0, FSS_WRITE_basic_list_program_name_long_s_length);
+
   const f_string_static_t fss_write_format_code_short_0002_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_short_0002_s, 0, FSS_WRITE_format_code_short_0002_s_length);
   const f_string_static_t fss_write_format_code_long_0002_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_long_0002_s, 0, FSS_WRITE_format_code_long_0002_s_length);
   const f_string_static_t fss_write_format_code_human_0002_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_human_0002_s, 0, FSS_WRITE_format_code_human_0002_s_length);
index f0b39cdf90f081a1d36b80a89cfc134e5f6d028c..11cfe387b90c981606dd7204a14515891402a528 100644 (file)
@@ -22,18 +22,27 @@ extern "C" {
 #ifndef _di_fss_write_basic_list_strings_
   #define FSS_WRITE_basic_list_standard_s "FSS-0002 (Basic List)"
 
+  #define FSS_WRITE_basic_list_program_name_s      "fss_basic_list_write"
+  #define FSS_WRITE_basic_list_program_name_long_s "FSS Basic List Write"
+
   #define FSS_WRITE_format_code_short_0002_s "0002"
   #define FSS_WRITE_format_code_long_0002_s  "fss-0002"
   #define FSS_WRITE_format_code_human_0002_s "basic list"
 
   #define FSS_WRITE_basic_list_standard_s_length 21
 
+  #define FSS_WRITE_basic_list_program_name_s_length      20
+  #define FSS_WRITE_basic_list_program_name_long_s_length 20
+
   #define FSS_WRITE_format_code_short_0002_s_length 4
   #define FSS_WRITE_format_code_long_0002_s_length  8
   #define FSS_WRITE_format_code_human_0002_s_length 10
 
   extern const f_string_static_t fss_write_basic_list_standard_s;
 
+  extern const f_string_static_t fss_write_basic_list_program_name_s;
+  extern const f_string_static_t fss_write_basic_list_program_name_long_s;
+
   extern const f_string_static_t fss_write_format_code_short_0002_s;
   extern const f_string_static_t fss_write_format_code_long_0002_s;
   extern const f_string_static_t fss_write_format_code_human_0002_s;
index 2d03b16e17572ff0f55ac75131c5b9e153ae69e3..8e3452d890ee3d72d2511921c1a09ad4a99a5593 100644 (file)
@@ -8,6 +8,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.process_help = &fss_write_basic_list_process_help;
   setting.process_pipe = &fss_write_basic_list_process_pipe;
   setting.process_normal = &fss_write_basic_list_process_normal;
+  setting.program_name = &fss_write_basic_list_program_name_s;
+  setting.program_name_long = &fss_write_basic_list_program_name_long_s;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -24,7 +26,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, &data, &setting);
+    fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
   fss_write_basic_list_main(&data, &setting);
index 51ac9d36ec6a63d04a45a376698a071223980aea..78a16fab92ccb162417ba19fe93fcb2accb36f74 100644 (file)
@@ -12,15 +12,21 @@ extern "C" {
 
     f_print_dynamic_raw(setting->line_first, print.to);
 
-    fll_program_print_help_header(print, fss_write_program_name_long_s, fss_write_program_version_s);
+    fll_program_print_help_header(print, setting->program_name_long ? *setting->program_name_long : fss_write_program_name_long_s, fss_write_program_version_s);
 
     fss_write_print_help(setting, print);
 
     f_print_dynamic_raw(f_string_eol_s, print.to);
 
-    fll_program_print_help_usage(print, fss_write_program_name_s, f_string_empty_s);
+    fll_program_print_help_usage(print, setting->program_name ? *setting->program_name : fss_write_program_name_s, f_string_empty_s);
 
-    // @todo
+    fss_write_print_help_pipe(setting, print);
+
+    fl_print_format("%r  The FSS-0002 (Basic List) specification does not support quoted names, therefore the parameters '%[%r%r%]'", print.to, f_string_eol_s, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_single_s, print.set->notable);
+    fl_print_format(" and '%[%r%r%]' do nothing.%r%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_double_s, print.set->notable, f_string_eol_s, f_string_eol_s);
+
+    fl_print_format("  This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_ignore_s, print.set->notable, f_string_eol_s);
+    fl_print_format("  This parameter requires two values.%r", print.to, f_string_eol_s);
 
     f_print_dynamic_raw(setting->line_last, print.to);
 
index 54f60c197600b24538f8aff7fa78474083cfb99e..bedc8e79b380c74113a82ab42fb3d78cd34f4465 100644 (file)
@@ -7,6 +7,9 @@ extern "C" {
 #ifndef _di_fss_write_embedded_list_strings_
   const f_string_static_t fss_write_embedded_list_standard_s = macro_f_string_static_t_initialize(FSS_WRITE_embedded_list_standard_s, 0, FSS_WRITE_embedded_list_standard_s_length);
 
+  const f_string_static_t fss_write_embedded_list_program_name_s = macro_f_string_static_t_initialize(FSS_WRITE_embedded_list_program_name_s, 0, FSS_WRITE_embedded_list_program_name_s_length);
+  const f_string_static_t fss_write_embedded_list_program_name_long_s = macro_f_string_static_t_initialize(FSS_WRITE_embedded_list_program_name_long_s, 0, FSS_WRITE_embedded_list_program_name_long_s_length);
+
   const f_string_static_t fss_write_format_code_short_0008_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_short_0008_s, 0, FSS_WRITE_format_code_short_0008_s_length);
   const f_string_static_t fss_write_format_code_long_0008_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_long_0008_s, 0, FSS_WRITE_format_code_long_0008_s_length);
   const f_string_static_t fss_write_format_code_human_0008_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_human_0008_s, 0, FSS_WRITE_format_code_human_0008_s_length);
index 296934b98c0f461aa26f63b1dc0301285586ec4f..f4f05e371a706d0997e5d92a7efa9549db673b04 100644 (file)
@@ -22,21 +22,26 @@ extern "C" {
 #ifndef _di_fss_write_embedded_list_strings_
   #define FSS_WRITE_embedded_list_standard_s "FSS-0008 (Embedded List)"
 
-  #define FSS_WRITE_embedded_list_standard_s_length 24
-
-  extern const f_string_static_t fss_write_embedded_list_standard_s;
+  #define FSS_WRITE_embedded_list_program_name_s      "fss_embedded_list_write"
+  #define FSS_WRITE_embedded_list_program_name_long_s "FSS Embedded List Write"
 
   #define FSS_WRITE_format_code_short_0008_s "0008"
   #define FSS_WRITE_format_code_long_0008_s  "fss-0008"
   #define FSS_WRITE_format_code_human_0008_s "basic"
 
-  #define FSS_WRITE_basic_standard_s_length 16
+  #define FSS_WRITE_embedded_list_standard_s_length 24
+
+  #define FSS_WRITE_embedded_list_program_name_s_length      23
+  #define FSS_WRITE_embedded_list_program_name_long_s_length 23
 
   #define FSS_WRITE_format_code_short_0008_s_length 4
   #define FSS_WRITE_format_code_long_0008_s_length  8
   #define FSS_WRITE_format_code_human_0008_s_length 5
 
-  extern const f_string_static_t fss_write_basic_standard_s;
+  extern const f_string_static_t fss_write_embedded_list_standard_s;
+
+  extern const f_string_static_t fss_write_embedded_list_program_name_s;
+  extern const f_string_static_t fss_write_embedded_list_program_name_long_s;
 
   extern const f_string_static_t fss_write_format_code_short_0008_s;
   extern const f_string_static_t fss_write_format_code_long_0008_s;
index bef1732a5609f9e7d70bccc00c972b52889b4f80..2652249598d53926c7bc0d371ed5699afeb75966 100644 (file)
@@ -8,6 +8,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.process_help = &fss_write_embedded_list_process_help;
   setting.process_pipe = &fss_write_embedded_list_process_pipe;
   setting.process_normal = &fss_write_embedded_list_process_normal;
+  setting.program_name = &fss_write_embedded_list_program_name_s;
+  setting.program_name_long = &fss_write_embedded_list_program_name_long_s;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -24,7 +26,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, &data, &setting);
+    fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
   fss_write_embedded_list_main(&data, &setting);
index a1ee9f18055196806c20f871859806ecd67f3143..20255fd3a65d1ed405a497d8b055daea1045c3de 100644 (file)
@@ -12,15 +12,24 @@ extern "C" {
 
     f_print_dynamic_raw(setting->line_first, print.to);
 
-    fll_program_print_help_header(print, fss_write_program_name_long_s, fss_write_program_version_s);
+    fll_program_print_help_header(print, setting->program_name_long ? *setting->program_name_long : fss_write_program_name_long_s, fss_write_program_version_s);
 
     fss_write_print_help(setting, print);
 
     f_print_dynamic_raw(f_string_eol_s, print.to);
 
-    fll_program_print_help_usage(print, fss_write_program_name_s, f_string_empty_s);
+    fll_program_print_help_usage(print, setting->program_name ? *setting->program_name : fss_write_program_name_s, f_string_empty_s);
 
-    // @todo
+    fss_write_print_help_pipe(setting, print);
+
+    fl_print_format("%r  The FSS-0008 (Embedded List) specification does not support quoted names, therefore the parameters '%[%r%r%]'", print.to, f_string_eol_s, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_single_s, print.set->notable);
+    fl_print_format(" and '%[%r%r%]' do nothing.%r%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_double_s, print.set->notable, f_string_eol_s, f_string_eol_s);
+
+    fl_print_format("  The parameter '%[%r%r%]' designates to not escape any valid nested Object or Content within some Content.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_ignore_s, print.set->notable, f_string_eol_s);
+    fl_print_format("  This parameter requires two values.%r", print.to, f_string_eol_s);
+    fl_print_format("  This parameter is not used for ignoring anything from the input pipe.%r", print.to, f_string_eol_s);
+    fl_print_format("  This parameter must be specified after a '%[%r%r%]'", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.set->notable);
+    fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%r%r%]' parameter.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.set->notable, f_string_eol_s);
 
     f_print_dynamic_raw(setting->line_last, print.to);
 
index 18ea2c131e4f39b03de51c7585e5eaba24f641ce..dca3a8ce3c753c5e45c6e47198ed86512ac6ac00 100644 (file)
@@ -7,6 +7,9 @@ extern "C" {
 #ifndef _di_fss_write_extended_strings_
   const f_string_static_t fss_write_extended_standard_s = macro_f_string_static_t_initialize(FSS_WRITE_extended_standard_s, 0, FSS_WRITE_extended_standard_s_length);
 
+  const f_string_static_t fss_write_extended_program_name_s = macro_f_string_static_t_initialize(FSS_WRITE_extended_program_name_s, 0, FSS_WRITE_extended_program_name_s_length);
+  const f_string_static_t fss_write_extended_program_name_long_s = macro_f_string_static_t_initialize(FSS_WRITE_extended_program_name_long_s, 0, FSS_WRITE_extended_program_name_long_s_length);
+
   const f_string_static_t fss_write_format_code_short_0001_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_short_0001_s, 0, FSS_WRITE_format_code_short_0001_s_length);
   const f_string_static_t fss_write_format_code_long_0001_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_long_0001_s, 0, FSS_WRITE_format_code_long_0001_s_length);
   const f_string_static_t fss_write_format_code_human_0001_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_human_0001_s, 0, FSS_WRITE_format_code_human_0001_s_length);
index 4bafcbc48f8596179013b31e452fa971336b131e..595cd9da48714e741351080f09856892ca421f47 100644 (file)
@@ -22,18 +22,27 @@ extern "C" {
 #ifndef _di_fss_write_extended_strings_
   #define FSS_WRITE_extended_standard_s "FSS-0001 (Extended)"
 
+  #define FSS_WRITE_extended_program_name_s      "fss_extended_write"
+  #define FSS_WRITE_extended_program_name_long_s "FSS Extended Write"
+
   #define FSS_WRITE_format_code_short_0001_s "0001"
   #define FSS_WRITE_format_code_long_0001_s  "fss-0001"
   #define FSS_WRITE_format_code_human_0001_s "extended"
 
   #define FSS_WRITE_extended_standard_s_length 19
 
+  #define FSS_WRITE_extended_program_name_s_length      18
+  #define FSS_WRITE_extended_program_name_long_s_length 18
+
   #define FSS_WRITE_format_code_short_0001_s_length 4
   #define FSS_WRITE_format_code_long_0001_s_length  8
   #define FSS_WRITE_format_code_human_0001_s_length 8
 
   extern const f_string_static_t fss_write_extended_standard_s;
 
+  extern const f_string_static_t fss_write_extended_program_name_s;
+  extern const f_string_static_t fss_write_extended_program_name_long_s;
+
   extern const f_string_static_t fss_write_format_code_short_0001_s;
   extern const f_string_static_t fss_write_format_code_long_0001_s;
   extern const f_string_static_t fss_write_format_code_human_0001_s;
index 70fc136610246f224b52f3de0eca297225579ce5..e4777f3e1b870ab33de5749f312c2709c8272ec2 100644 (file)
@@ -8,6 +8,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.process_help = &fss_write_extended_process_help;
   setting.process_pipe = &fss_write_extended_process_pipe;
   setting.process_normal = &fss_write_extended_process_normal;
+  setting.program_name = &fss_write_extended_program_name_s;
+  setting.program_name_long = &fss_write_extended_program_name_long_s;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -24,7 +26,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, &data, &setting);
+    fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
   fss_write_extended_main(&data, &setting);
index c634825d0c2474a3edb16a2d2db3b12e2e12042b..ec4ff7fe9e5594b555b079c8b50f92b7eaa01bd7 100644 (file)
@@ -12,15 +12,21 @@ extern "C" {
 
     f_print_dynamic_raw(setting->line_first, print.to);
 
-    fll_program_print_help_header(print, fss_write_program_name_long_s, fss_write_program_version_s);
+    fll_program_print_help_header(print, setting->program_name_long ? *setting->program_name_long : fss_write_program_name_long_s, fss_write_program_version_s);
 
     fss_write_print_help(setting, print);
 
     f_print_dynamic_raw(f_string_eol_s, print.to);
 
-    fll_program_print_help_usage(print, fss_write_program_name_s, f_string_empty_s);
+    fll_program_print_help_usage(print, setting->program_name ? *setting->program_name : fss_write_program_name_s, f_string_empty_s);
 
-    // @todo
+    fss_write_print_help_pipe(setting, print);
+
+    fl_print_format("%r  The FSS-0001 (Extended) specification does not support multi-line Content, therefore the parameter '%[%r%r%]'", print.to, f_string_eol_s, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_prepend_s, print.set->notable);
+    fl_print_format(" does nothing.%r%r", print.to, f_string_eol_s, f_string_eol_s);
+
+    fl_print_format("  This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_ignore_s, print.set->notable, f_string_eol_s);
+    fl_print_format("  This parameter requires two values.%r", print.to, f_string_eol_s);
 
     f_print_dynamic_raw(setting->line_last, print.to);
 
index 20157d411ff066ca3a3b4a07509dda3c593b57e0..6645cd30700a4adf75d6e8ec2a664b7dd0185e46 100644 (file)
@@ -7,6 +7,9 @@ extern "C" {
 #ifndef _di_fss_write_extended_list_strings_
   const f_string_static_t fss_write_extended_list_standard_s = macro_f_string_static_t_initialize(FSS_WRITE_extended_list_standard_s, 0, FSS_WRITE_extended_list_standard_s_length);
 
+  const f_string_static_t fss_write_extended_list_program_name_s = macro_f_string_static_t_initialize(FSS_WRITE_extended_list_program_name_s, 0, FSS_WRITE_extended_list_program_name_s_length);
+  const f_string_static_t fss_write_extended_list_program_name_long_s = macro_f_string_static_t_initialize(FSS_WRITE_extended_list_program_name_long_s, 0, FSS_WRITE_extended_list_program_name_long_s_length);
+
   const f_string_static_t fss_write_format_code_short_0003_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_short_0003_s, 0, FSS_WRITE_format_code_short_0003_s_length);
   const f_string_static_t fss_write_format_code_long_0003_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_long_0003_s, 0, FSS_WRITE_format_code_long_0003_s_length);
   const f_string_static_t fss_write_format_code_human_0003_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_human_0003_s, 0, FSS_WRITE_format_code_human_0003_s_length);
index 5257247c0fc4aad84c1cb54e8b7413b37f7340c7..f842ab186ae6f5fae1a15a88b11b57917536197e 100644 (file)
@@ -22,18 +22,27 @@ extern "C" {
 #ifndef _di_fss_write_extended_list_strings_
   #define FSS_WRITE_extended_list_standard_s "FSS-0003 (Extended List)"
 
+  #define FSS_WRITE_extended_list_program_name_s      "fss_extended_list_write"
+  #define FSS_WRITE_extended_list_program_name_long_s "FSS Extended List Write"
+
   #define FSS_WRITE_format_code_short_0003_s "0003"
   #define FSS_WRITE_format_code_long_0003_s  "fss-0003"
   #define FSS_WRITE_format_code_human_0003_s "extended list"
 
   #define FSS_WRITE_extended_list_standard_s_length 24
 
+  #define FSS_WRITE_extended_list_program_name_s_length      23
+  #define FSS_WRITE_extended_list_program_name_long_s_length 23
+
   #define FSS_WRITE_format_code_short_0003_s_length 4
   #define FSS_WRITE_format_code_long_0003_s_length  8
   #define FSS_WRITE_format_code_human_0003_s_length 13
 
   extern const f_string_static_t fss_write_extended_list_standard_s;
 
+  extern const f_string_static_t fss_write_extended_list_program_name_s;
+  extern const f_string_static_t fss_write_extended_list_program_name_long_s;
+
   extern const f_string_static_t fss_write_format_code_short_0003_s;
   extern const f_string_static_t fss_write_format_code_long_0003_s;
   extern const f_string_static_t fss_write_format_code_human_0003_s;
index f6714b89beb93619df9835fb02fd37764f751dd7..20d3dd4c0fae7d152ce51704a8b6b256445dc636 100644 (file)
@@ -8,6 +8,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.process_help = &fss_write_extended_list_process_help;
   setting.process_pipe = &fss_write_extended_list_process_pipe;
   setting.process_normal = &fss_write_extended_list_process_normal;
+  setting.program_name = &fss_write_extended_list_program_name_s;
+  setting.program_name_long = &fss_write_extended_list_program_name_long_s;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -24,7 +26,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, &data, &setting);
+    fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
   fss_write_extended_list_main(&data, &setting);
index 7e882b0395b061267f52f0fe09a529cb88b1ac64..0409242f5d9a197dff7630635a7657fda593cd8e 100644 (file)
@@ -12,15 +12,24 @@ extern "C" {
 
     f_print_dynamic_raw(setting->line_first, print.to);
 
-    fll_program_print_help_header(print, fss_write_program_name_long_s, fss_write_program_version_s);
+    fll_program_print_help_header(print, setting->program_name_long ? *setting->program_name_long : fss_write_program_name_long_s, fss_write_program_version_s);
 
     fss_write_print_help(setting, print);
 
     f_print_dynamic_raw(f_string_eol_s, print.to);
 
-    fll_program_print_help_usage(print, fss_write_program_name_s, f_string_empty_s);
+    fll_program_print_help_usage(print, setting->program_name ? *setting->program_name : fss_write_program_name_s, f_string_empty_s);
 
-    // @todo
+    fss_write_print_help_pipe(setting, print);
+
+    fl_print_format("%r  The FSS-0003 (Extended List) specification does not support quoted names, therefore the parameters '%[%r%r%]'", print.to, f_string_eol_s, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_single_s, print.set->notable);
+    fl_print_format(" and '%[%r%r%]' do nothing.%r%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_double_s, print.set->notable, f_string_eol_s, f_string_eol_s);
+
+    fl_print_format("  The parameter '%[%r%r%]' designates to not escape any valid nested Object or Content within some Content.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_ignore_s, print.set->notable, f_string_eol_s);
+    fl_print_format("  This parameter requires two values.%r", print.to, f_string_eol_s);
+    fl_print_format("  This parameter is not used for ignoring anything from the input pipe.%r", print.to, f_string_eol_s);
+    fl_print_format("  This parameter must be specified after a '%[%r%r%]'", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.set->notable);
+    fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%r%r%]' parameter.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.set->notable, f_string_eol_s);
 
     f_print_dynamic_raw(setting->line_last, print.to);
 
index cde0e3d5d18a1c5ff775d43862c2e87998679708..69d7ccdf20de086b8534fbbce2abc8e741f68278 100644 (file)
@@ -68,7 +68,7 @@ extern "C" {
 #endif // _di_fss_write_setting_delete_
 
 #ifndef _di_fss_write_setting_load_
-  void fss_write_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting) {
+  void fss_write_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting, void (*callback)(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting)) {
 
     if (!main || !setting) return;
 
@@ -134,38 +134,34 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[fss_write_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= fss_write_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[fss_write_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= fss_write_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
-    if (main->parameters.array[fss_write_parameter_file_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_file_e].values.used) {
-      // @todo check the "-a/--as" and select format or fallback to FSS-0000 Basic (support either digits "0000"/"0001" or simple names "basic"/"basic_list".
-    // Fallback only happens if -a/--as is not disabled, otherwise the callback function should be pre-defined.
+    if (main->parameters.array[fss_write_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= fss_write_main_flag_help_e;
     }
-    else if (main->parameters.array[fss_write_parameter_as_e].result & f_console_result_found_e) {
-      setting->status = F_status_set_error(F_parameter);
 
-      fss_write_print_line_first_locked(setting, main->error);
-      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
-      fss_write_print_line_last_locked(setting, main->error);
+    if (main->parameters.array[fss_write_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= fss_write_main_flag_version_e;
+    }
 
-      return;
+    if (callback) {
+      callback(arguments, main, setting);
+      if (F_status_is_error(setting->status)) return;
+
+      if (setting->status == F_done) {
+        setting->status = F_none;
+
+        return;
+      }
     }
 
+    if (main->parameters.array[fss_write_parameter_help_e].result & f_console_result_found_e) return;
+    if (main->parameters.array[fss_write_parameter_version_e].result & f_console_result_found_e) return;
+
     if (main->parameters.array[fss_write_parameter_file_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_file_e].values.used) {
       if (main->parameters.array[fss_write_parameter_file_e].values.used > 1) {
         setting->status = F_status_set_error(F_parameter);
index 2d5802b3064280d71c8696175692d4beced1a9e2..fc3f3eee0603609242d943e21c7044eeecf503ea 100644 (file)
@@ -86,32 +86,6 @@ extern "C" {
 #endif // _di_fss_write_defines_
 
 /**
- * Designate the supported formats for the main (fss_write) program.
- *
- * These are intended to be used for communicating or selecting an "--as" option.
- *
- * The digit value of the codes are intended to exactly match the numeric representation.
- *
- * fss_write_format_code_*_e:
- *   - 0000: The FSS-0000 (Basic) format.
- *   - 0001: The FSS-0001 (Extended) format.
- *   - 0002: The FSS-0002 (Basic List) format.
- *   - 0003: The FSS-0003 (Extended List) format.
- *   - 0008: The FSS-0008 (Embedded List) format.
- *   - 000e: The FSS-000E (Payload) format.
- */
-#ifndef _di_fss_write_formats_
-  enum {
-    fss_write_format_code_0000_e = 0x0,
-    fss_write_format_code_0001_e = 0x1,
-    fss_write_format_code_0002_e = 0x2,
-    fss_write_format_code_0003_e = 0x3,
-    fss_write_format_code_0008_e = 0x8,
-    fss_write_format_code_000e_e = 0xe,
-  };
-#endif // _di_fss_write_formats_
-
-/**
  * A collection of static strings associated with FSS Payload Write.
  */
 #ifndef _di_fss_write_strings_
@@ -340,6 +314,9 @@ extern "C" {
     f_string_dynamics_t objects;
     f_string_dynamics_t contents;
 
+    const f_string_static_t *program_name;
+    const f_string_static_t *program_name_long;
+
     void (*process_help)(fll_program_data_t * const main, void * const setting);
     void (*process_normal)(fll_program_data_t * const main, void * const setting);
     void (*process_pipe)(fll_program_data_t * const main, void * const setting);
@@ -365,6 +342,8 @@ extern "C" {
       0, \
       0, \
       0, \
+      0, \
+      0, \
     }
 #endif // _di_fss_write_setting_t_
 
@@ -408,6 +387,10 @@ extern "C" {
  *     Errors (with error bit) from: f_string_dynamics_resize().
  *     Errors (with error bit) from: fll_program_parameter_process_context().
  *     Errors (with error bit) from: fll_program_parameter_process_verbosity().
+ * @param callback
+ *   (optional) Designate a function to call after performing the initial processing, but before printing help.
+ *   If the function returns F_done, then this function immediately returns, resetting status to F_none.
+ *   Set to NULL to disable.
  *
  * @see f_console_parameter_process()
  * @see f_file_stream_open()
@@ -416,7 +399,7 @@ extern "C" {
  * @see fll_program_parameter_process_verbosity()
  */
 #ifndef _di_fss_write_setting_load_
-  extern void fss_write_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting);
+  extern void fss_write_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting, void (*callback)(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting));
 #endif // _di_fss_write_setting_load_
 
 /**
index d8634d20c663b47505e4e245a0b6cc292d9249ed..3b2f07dd4bba67b6d21a14050cb52780b54ba68f 100644 (file)
@@ -12,11 +12,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
   setting.state.data = (void *) &data;
-
-  // Default to Basic.
-  setting.process_help = &fss_write_main_process_help;
-  setting.process_pipe = &fss_write_basic_process_pipe;
-  setting.process_normal = &fss_write_basic_process_normal;
+  setting.program_name = &fss_write_program_name_s;
+  setting.program_name_long = &fss_write_program_name_long_s;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -32,7 +29,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, &data, &setting);
+    fss_write_setting_load(arguments, &data, &setting, &fss_write_main_setting_load_as);
   }
 
   fss_write_main(&data, &setting);
@@ -66,9 +63,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
     fll_program_print_help_usage(main->message, fss_write_program_name_s, f_string_empty_s);
 
+    fss_write_print_help_pipe(setting, main->message);
+
     f_print_dynamic_raw(f_string_eol_s, main->message.to);
 
-    fl_print_format("  The '%[%r%r%]' parameter supports the following standards with the specified possible case-sensitive values%r", main->message.to, main->message.set->notable, f_console_symbol_long_normal_s, fss_write_long_as_s, main->message.set->notable, f_string_eol_s);
+    fl_print_format("  The '%[%r%r%]' parameter supports the following standards with the specified possible case-sensitive values:%r", main->message.to, main->message.set->notable, f_console_symbol_long_normal_s, fss_write_long_as_s, main->message.set->notable, f_string_eol_s);
 
     // FSS-0000 (Basic)
     fl_print_format("    - As %[%r%]         format: ", main->message.to, main->message.set->notable, fss_write_basic_standard_s, main->message.set->notable);
@@ -117,3 +116,117 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     f_file_stream_unlock(main->message.to);
   }
 #endif // _di_fss_write_main_process_help_
+
+#ifndef _di_fss_write_main_setting_load_as_
+  void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting) {
+
+    if (!main || !setting || F_status_is_error(setting->status) || (setting->flag & fss_write_main_flag_version_e)) return;
+
+    setting->program_name = &fss_write_program_name_s;
+    setting->program_name_long = &fss_write_program_name_long_s;
+    setting->process_help = &fss_write_main_process_help;
+    setting->process_pipe = &fss_write_basic_process_pipe;
+    setting->process_normal = &fss_write_basic_process_normal;
+
+    if (main->parameters.array[fss_write_parameter_as_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_as_e].values.used) {
+
+      f_array_length_t index = 0;
+      f_string_static_t *argv = main->parameters.arguments.array;
+
+      for (f_array_length_t i = 0; i < main->parameters.array[fss_write_parameter_as_e].values.used; ++i) {
+
+        index = main->parameters.array[fss_write_parameter_as_e].values.array[i];
+
+        if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0000_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0000_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0000_s) == F_equal_to) {
+
+          setting->program_name = &fss_write_basic_program_name_s;
+          setting->program_name_long = &fss_write_basic_program_name_long_s;
+          setting->process_help = &fss_write_basic_process_help;
+          setting->process_pipe = &fss_write_basic_process_pipe;
+          setting->process_normal = &fss_write_basic_process_normal;
+        }
+        else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0001_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0001_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0001_s) == F_equal_to) {
+
+          setting->program_name = &fss_write_extended_program_name_s;
+          setting->program_name_long = &fss_write_extended_program_name_long_s;
+          setting->process_help = &fss_write_extended_process_help;
+          setting->process_pipe = &fss_write_extended_process_pipe;
+          setting->process_normal = &fss_write_extended_process_normal;
+        }
+        else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0002_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0002_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0002_s) == F_equal_to) {
+
+          setting->program_name = &fss_write_basic_list_program_name_s;
+          setting->program_name_long = &fss_write_basic_list_program_name_long_s;
+          setting->process_help = &fss_write_basic_list_process_help;
+          setting->process_pipe = &fss_write_basic_list_process_pipe;
+          setting->process_normal = &fss_write_basic_list_process_normal;
+        }
+        else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0003_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0003_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0003_s) == F_equal_to) {
+
+          setting->program_name = &fss_write_extended_list_program_name_s;
+          setting->program_name_long = &fss_write_extended_list_program_name_long_s;
+          setting->process_help = &fss_write_extended_list_process_help;
+          setting->process_pipe = &fss_write_extended_list_process_pipe;
+          setting->process_normal = &fss_write_extended_list_process_normal;
+        }
+        else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0008_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0008_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0008_s) == F_equal_to) {
+
+          setting->program_name = &fss_write_embedded_list_program_name_s;
+          setting->program_name_long = &fss_write_embedded_list_program_name_long_s;
+          setting->process_help = &fss_write_embedded_list_process_help;
+          setting->process_pipe = &fss_write_embedded_list_process_pipe;
+          setting->process_normal = &fss_write_embedded_list_process_normal;
+        }
+        else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_000e_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_long_000e_s) == F_equal_to ||
+            fl_string_dynamic_compare(argv[index], fss_write_format_code_human_000e_s) == F_equal_to) {
+
+          setting->program_name = &fss_write_payload_program_name_s;
+          setting->program_name_long = &fss_write_payload_program_name_long_s;
+          setting->process_help = &fss_write_payload_process_help;
+          setting->process_pipe = &fss_write_payload_process_pipe;
+          setting->process_normal = &fss_write_payload_process_normal;
+
+        }
+        else {
+          // @todo print error
+
+          setting->status = F_status_set_error(F_parameter);
+        }
+      } // for
+
+      if (F_status_is_error(setting->status)) {
+        if (setting->flag & fss_write_main_flag_help_e) {
+          fss_write_main_process_help(main, setting);
+        }
+
+        return;
+      }
+    }
+    else if (main->parameters.array[fss_write_parameter_as_e].result & f_console_result_found_e) {
+      setting->status = F_status_set_error(F_parameter);
+
+      if (setting->flag & fss_write_main_flag_help_e) {
+        fss_write_main_process_help(main, setting);
+
+        return;
+      }
+
+      fss_write_print_line_first_locked(setting, main->error);
+      fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_as_s);
+      fss_write_print_line_last_locked(setting, main->error);
+
+      return;
+    }
+  }
+#endif // _di_fss_write_main_setting_load_as_
index a4b3d5d38c84e095ef4f972f43457966bffc5d6a..0025bdaf91b0f34bfaf765debf67db09a1421cc7 100644 (file)
@@ -35,6 +35,52 @@ extern "C" {
   extern void fss_write_main_process_help(fll_program_data_t * const main, void * const setting);
 #endif // _di_fss_write_main_process_help_
 
+/**
+ * Perform the standard program setting load process for the "--as" parameter.
+ *
+ * This should be called before fss_write_setting_load() is called to ensure "--as" gets processed before "--help".
+ *
+ * This prints error messages as appropriate.
+ *
+ * If either main or setting is NULL, then this immediately retuns without doing anything.
+ *
+ * @param arguments
+ *   The parameters passed to the process (often referred to as command line arguments).
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *
+ *   This alters setting.process_help, setting.process_normal, and setting.process_pipe.
+ *
+ *   This alters setting.status:
+ *     F_none on success.
+ *     F_interrupt on (exit) signal received.
+ *
+ *     F_parameter (with error bit) if main is NULL or setting is NULL.
+ *
+ *   This alters setting.status:
+ *     F_none on success.
+ *     F_data_not on success but nothing was provided to operate with.
+ *
+ *     Errors (with error bit) from: f_console_parameter_process().
+ *     Errors (with error bit) from: f_file_stream_open().
+ *     Errors (with error bit) from: f_string_dynamics_resize().
+ *     Errors (with error bit) from: fll_program_parameter_process_context().
+ *     Errors (with error bit) from: fll_program_parameter_process_verbosity().
+ *
+ * @see f_console_parameter_process()
+ * @see f_file_stream_open()
+ * @see f_string_dynamics_resize()
+ * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_verbosity()
+ *
+ * @see fss_write_setting_load()
+ */
+#ifndef _di_fss_write_main_setting_load_as_
+  extern void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting);
+#endif // _di_fss_write_main_setting_load_as_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 8b29731a695b5a4008a3f953c4f5c47538386a56..10d656e5cb711c16cf104a5a202a4d5b24633dd5 100644 (file)
@@ -118,6 +118,19 @@ extern "C" {
   }
 #endif // _di_fss_write_print_help_
 
+#ifndef _di_fss_write_print_help_pipe_
+  void fss_write_print_help_pipe(fss_write_setting_t * const setting, const fl_print_t print) {
+
+    fl_print_format("%r  The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%r", print.to, f_string_eol_s, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
+    fl_print_format("  The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
+    fl_print_format("  The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range (use this both before and after the range).%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
+    fl_print_format("  For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable);
+    fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
+    fl_print_format("  The end of the pipe represents the end of any Object or Content.%r", print.to, f_string_eol_s);
+
+  }
+#endif // _di_fss_write_print_help_pipe_
+
 #ifndef _di_fss_write_print_line_first_locked_
   f_status_t fss_write_print_line_first_locked(fss_write_setting_t * const setting, const fl_print_t print) {
 
index f87a8bcb464b5061dd5b603a92a5a53d4fc02168..54ae87c3e41f1439de1ce53487033fc4a784e510 100644 (file)
@@ -154,6 +154,22 @@ extern "C" {
 #endif // _di_fss_write_print_help_
 
 /**
+ * Print standard parts of the help regarding pipe usage.
+ *
+ * This is expected to be called as part of the help printing and does not perform any locking.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.status.
+ * @param print
+ *   The output structure to print to.
+ */
+#ifndef _di_fss_write_print_help_pipe_
+  extern void fss_write_print_help_pipe(fss_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_write_print_help_pipe_
+
+/**
  * Print first new line, unless verbosity says otherwise.
  *
  * This is generally either the first line in the program or the first line printed before an error message.
index 54bb78c8d909f160d27c46ef16473e0f9d4f0f30..88e7991f0a7de73fc510c9b8ceb2c2551eee6748 100644 (file)
@@ -7,6 +7,9 @@ extern "C" {
 #ifndef _di_fss_write_payload_strings_
   const f_string_static_t fss_write_payload_standard_s = macro_f_string_static_t_initialize(FSS_WRITE_payload_standard_s, 0, FSS_WRITE_payload_standard_s_length);
 
+  const f_string_static_t fss_write_payload_program_name_s = macro_f_string_static_t_initialize(FSS_WRITE_payload_program_name_s, 0, FSS_WRITE_payload_program_name_s_length);
+  const f_string_static_t fss_write_payload_program_name_long_s = macro_f_string_static_t_initialize(FSS_WRITE_payload_program_name_long_s, 0, FSS_WRITE_payload_program_name_long_s_length);
+
   const f_string_static_t fss_write_format_code_short_000e_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_short_000e_s, 0, FSS_WRITE_format_code_short_000e_s_length);
   const f_string_static_t fss_write_format_code_long_000e_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_long_000e_s, 0, FSS_WRITE_format_code_long_000e_s_length);
   const f_string_static_t fss_write_format_code_human_000e_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_human_000e_s, 0, FSS_WRITE_format_code_human_000e_s_length);
index afccfc6a35c5177098636234c5b74335bf41ccee..46ded6740359f528c7815a78c400032239c53012 100644 (file)
@@ -22,18 +22,27 @@ extern "C" {
 #ifndef _di_fss_write_payload_strings_
   #define FSS_WRITE_payload_standard_s "FSS-000E (Payload)"
 
+  #define FSS_WRITE_payload_program_name_s      "fss_payload_write"
+  #define FSS_WRITE_payload_program_name_long_s "FSS Payload Write"
+
   #define FSS_WRITE_format_code_short_000e_s "000e"
   #define FSS_WRITE_format_code_long_000e_s  "fss-000e"
   #define FSS_WRITE_format_code_human_000e_s "payload"
 
   #define FSS_WRITE_payload_standard_s_length 18
 
+  #define FSS_WRITE_payload_program_name_s_length      17
+  #define FSS_WRITE_payload_program_name_long_s_length 17
+
   #define FSS_WRITE_format_code_short_000e_s_length 4
   #define FSS_WRITE_format_code_long_000e_s_length  8
   #define FSS_WRITE_format_code_human_000e_s_length 7
 
   extern const f_string_static_t fss_write_payload_standard_s;
 
+  extern const f_string_static_t fss_write_payload_program_name_s;
+  extern const f_string_static_t fss_write_payload_program_name_long_s;
+
   extern const f_string_static_t fss_write_format_code_short_000e_s;
   extern const f_string_static_t fss_write_format_code_long_000e_s;
   extern const f_string_static_t fss_write_format_code_human_000e_s;
index bfd607442bee3b87f47c00da64fbd46643b53406..6aea424b945a3b6b30c753ed5a9cd5fbbe4c0e07 100644 (file)
@@ -8,6 +8,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.process_help = &fss_write_payload_process_help;
   setting.process_pipe = &fss_write_payload_process_pipe;
   setting.process_normal = &fss_write_payload_process_normal;
+  setting.program_name = &fss_write_payload_program_name_s;
+  setting.program_name_long = &fss_write_payload_program_name_long_s;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -24,7 +26,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, &data, &setting);
+    fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
   fss_write_main(&data, &setting);
index 1421d2280d07b3ccfa100686254112724bc9f010..8aaec236e422e07f14b2eadaad3f0b53889cbb9d 100644 (file)
@@ -12,22 +12,17 @@ extern "C" {
 
     f_print_dynamic_raw(setting->line_first, print.to);
 
-    fll_program_print_help_header(print, fss_write_program_name_long_s, fss_write_program_version_s);
+    fll_program_print_help_header(print, setting->program_name_long ? *setting->program_name_long : fss_write_program_name_long_s, fss_write_program_version_s);
 
     fss_write_print_help(setting, print);
 
     f_print_dynamic_raw(f_string_eol_s, print.to);
 
-    fll_program_print_help_usage(print, fss_write_program_name_s, f_string_empty_s);
+    fll_program_print_help_usage(print, setting->program_name ? *setting->program_name : fss_write_program_name_s, f_string_empty_s);
 
-    fl_print_format("%r  The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%r", print.to, f_string_eol_s, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
-    fl_print_format("  The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
-    fl_print_format("  The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range, which does nothing in this program.%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
-    fl_print_format("  For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable);
-    fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
-    fl_print_format("  The end of the pipe represents the end of any Object or Content.%r%r", print.to, f_string_eol_s, f_string_eol_s);
+    fss_write_print_help_pipe(setting, print);
 
-    fl_print_format("  The FSS-000E (Payload) specification does not support quoted names, therefore the parameters '%[%r%r%]'", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_single_s, print.set->notable);
+    fl_print_format("%r  The FSS-000E (Payload) specification does not support quoted names, therefore the parameters '%[%r%r%]'", print.to, f_string_eol_s, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_single_s, print.set->notable);
     fl_print_format(" and '%[%r%r%]' do nothing.%r%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_double_s, print.set->notable, f_string_eol_s, f_string_eol_s);
 
     fl_print_format("  This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_ignore_s, print.set->notable, f_string_eol_s);
index 842b0c12a99d6d869b0850fe4fe7ab0515db33e0..1433f8a514690eb47bb38ea51224a93e04046c07 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
     setting->status = F_none;
 
     if (setting->flag & iki_read_main_flag_help_e) {
-      iki_read_print_help(setting, main->message);
+      iki_read_print_help(main, setting, main->message);
 
       return;
     }
index 74b6b676f2ea98c0805436175149e5f17b707468..a4746bfa32a9741a0ff726b9553a7954a5d6fd54 100644 (file)
@@ -115,24 +115,24 @@ extern "C" {
           return;
         }
       }
-
-      if (main->parameters.array[iki_write_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= iki_write_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[iki_write_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= iki_write_main_flag_version_e;
-
-        return;
-      }
     }
 
     main->output.to.id = F_type_descriptor_output_d;
     main->output.to.stream = F_type_output_d;
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
+    if (main->parameters.array[iki_write_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= iki_write_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[iki_write_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= iki_write_main_flag_version_e;
+
+      return;
+    }
+
     if (main->parameters.array[iki_write_parameter_file_e].result & f_console_result_value_e && main->parameters.array[iki_write_parameter_file_e].values.used) {
       if (main->parameters.array[iki_write_parameter_file_e].values.used > 1) {
         setting->status = F_status_set_error(F_parameter);
index a6e0ccab8761c9d53f023df902fda115e2b9a4f2..4ee5260d9c1cc07036464bc84a0fb6fa89dd4020 100644 (file)
@@ -155,18 +155,6 @@ extern "C" {
         }
       }
 
-      if (main->parameters.array[utf8_parameter_help_e].result & f_console_result_found_e) {
-        setting->flag |= utf8_main_flag_help_e;
-
-        return;
-      }
-
-      if (main->parameters.array[utf8_parameter_version_e].result & f_console_result_found_e) {
-        setting->flag |= utf8_main_flag_version_e;
-
-        return;
-      }
-
       // Identify and prioritize "from" mode parameters.
       {
         uint16_t choices_array[2] = { utf8_parameter_from_bytesequence_e, utf8_parameter_from_codepoint_e };
@@ -277,6 +265,18 @@ extern "C" {
       }
     }
 
+    if (main->parameters.array[utf8_parameter_help_e].result & f_console_result_found_e) {
+      setting->flag |= utf8_main_flag_help_e;
+
+      return;
+    }
+
+    if (main->parameters.array[utf8_parameter_version_e].result & f_console_result_found_e) {
+      setting->flag |= utf8_main_flag_version_e;
+
+      return;
+    }
+
     if (main->parameters.array[utf8_parameter_to_file_e].result & f_console_result_value_e) {
       if (main->parameters.array[utf8_parameter_to_file_e].values.used > 1) {
         setting->status = F_status_set_error(F_parameter);