From 7a4ee26983b941ce0a8f72bcc02bf5566e9a7886 Mon Sep 17 00:00:00 2001 From: Wiimm Date: Sat, 22 Jul 2023 22:40:04 +0200 Subject: SZS v2.36a --- project/src/ui/ui-wpatt.c | 172 ++++++++++++++++++++++++++++------------------ 1 file changed, 105 insertions(+), 67 deletions(-) (limited to 'project/src/ui/ui-wpatt.c') diff --git a/project/src/ui/ui-wpatt.c b/project/src/ui/ui-wpatt.c index 7181a33..9c23cb3 100644 --- a/project/src/ui/ui-wpatt.c +++ b/project/src/ui/ui-wpatt.c @@ -75,6 +75,17 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = "Suppress cross reference comments." }, + { OPT_NO_WILDCARDS, false, false, false, false, false, 0, "no-wildcards", + 0, + "Disable wildcard parsing and use each filename exactly as specified." + }, + + { OPT_IN_ORDER, false, false, false, false, false, 0, "in-order", + 0, + "Process the input files in order of the command line and don't delete" + " duplicates." + }, + { OPT_NO_PARAM, false, false, false, false, false, 'P', "no-param", 0, "Disable parameter support in decoded KMP text files." @@ -157,7 +168,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = "Print in machine readable sections and parameter lines." }, - {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 18 + {0,0,0,0,0,0,0,0,0,0}, // OPT__N_SPECIFIC == 20 //----- global options ----- @@ -421,7 +432,7 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] = " helper option." }, - {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 53 + {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 55 }; @@ -584,6 +595,10 @@ static const struct option OptionLong[] = { "no-header", 0, 0, 'H' }, { "noheader", 0, 0, 'H' }, { "brief", 0, 0, 'B' }, + { "no-wildcards", 0, 0, GO_NO_WILDCARDS }, + { "nowildcards", 0, 0, GO_NO_WILDCARDS }, + { "in-order", 0, 0, GO_IN_ORDER }, + { "inorder", 0, 0, GO_IN_ORDER }, { "no-param", 0, 0, 'P' }, { "noparam", 0, 0, 'P' }, { "no-echo", 0, 0, GO_NO_ECHO }, @@ -694,19 +709,21 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /* 0x08c */ OPT_LE_CODE, /* 0x08d */ OPT_CHDIR, /* 0x08e */ OPT_ROUND, - /* 0x08f */ OPT_NO_ECHO, - /* 0x090 */ OPT_PAT, - /* 0x091 */ OPT_UTF_8, - /* 0x092 */ OPT_NO_UTF_8, - /* 0x093 */ OPT_FORCE, - /* 0x094 */ OPT_REPAIR_MAGICS, - /* 0x095 */ OPT_OLD, - /* 0x096 */ OPT_STD, - /* 0x097 */ OPT_NEW, - /* 0x098 */ OPT_EXTRACT, - /* 0x099 */ OPT_NUMBER, - /* 0x09a */ OPT_SECTIONS, - /* 0x09b */ 0,0,0,0, 0, + /* 0x08f */ OPT_NO_WILDCARDS, + /* 0x090 */ OPT_IN_ORDER, + /* 0x091 */ OPT_NO_ECHO, + /* 0x092 */ OPT_PAT, + /* 0x093 */ OPT_UTF_8, + /* 0x094 */ OPT_NO_UTF_8, + /* 0x095 */ OPT_FORCE, + /* 0x096 */ OPT_REPAIR_MAGICS, + /* 0x097 */ OPT_OLD, + /* 0x098 */ OPT_STD, + /* 0x099 */ OPT_NEW, + /* 0x09a */ OPT_EXTRACT, + /* 0x09b */ OPT_NUMBER, + /* 0x09c */ OPT_SECTIONS, + /* 0x09d */ 0,0,0, /* 0x0a0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0b0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* 0x0c0 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -724,94 +741,94 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] = /////////////// opt_allowed_cmd_* /////////////// /////////////////////////////////////////////////////////////////////////////// -static u8 option_allowed_cmd_VERSION[18] = // cmd #1 +static u8 option_allowed_cmd_VERSION[20] = // cmd #1 { - 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,1 + 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1 }; -static u8 option_allowed_cmd_HELP[18] = // cmd #2 +static u8 option_allowed_cmd_HELP[20] = // cmd #2 { - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1 + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1 }; -static u8 option_allowed_cmd_CONFIG[18] = // cmd #3 +static u8 option_allowed_cmd_CONFIG[20] = // cmd #3 { - 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 }; -static u8 option_allowed_cmd_ARGTEST[18] = // cmd #4 +static u8 option_allowed_cmd_ARGTEST[20] = // cmd #4 { - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1 + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1 }; -static u8 option_allowed_cmd_EXPAND[18] = // cmd #5 +static u8 option_allowed_cmd_EXPAND[20] = // cmd #5 { - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1 + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1 }; -static u8 option_allowed_cmd_TEST[18] = // cmd #6 +static u8 option_allowed_cmd_TEST[20] = // cmd #6 { - 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1 + 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1 }; -static u8 option_allowed_cmd_COLORS[18] = // cmd #7 +static u8 option_allowed_cmd_COLORS[20] = // cmd #7 { - 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,1,0,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 }; -static u8 option_allowed_cmd_ERROR[18] = // cmd #8 +static u8 option_allowed_cmd_ERROR[20] = // cmd #8 { - 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,1 + 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,1 }; -static u8 option_allowed_cmd_FILETYPE[18] = // cmd #9 +static u8 option_allowed_cmd_FILETYPE[20] = // cmd #9 { - 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,1,0 + 0,0,1,0,0, 1,1,0,0,0, 0,0,0,0,0, 0,0,0,1,0 }; -static u8 option_allowed_cmd_FILEATTRIB[18] = // cmd #10 +static u8 option_allowed_cmd_FILEATTRIB[20] = // cmd #10 { - 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 }; -static u8 option_allowed_cmd_SYMBOLS[18] = // cmd #11 +static u8 option_allowed_cmd_SYMBOLS[20] = // cmd #11 { - 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 }; -static u8 option_allowed_cmd_FUNCTIONS[18] = // cmd #12 +static u8 option_allowed_cmd_FUNCTIONS[20] = // cmd #12 { - 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 }; -static u8 option_allowed_cmd_CALCULATE[18] = // cmd #13 +static u8 option_allowed_cmd_CALCULATE[20] = // cmd #13 { - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 }; -static u8 option_allowed_cmd_FLOAT[18] = // cmd #14 +static u8 option_allowed_cmd_FLOAT[20] = // cmd #14 { - 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 }; -static u8 option_allowed_cmd_EXPORT[18] = // cmd #15 +static u8 option_allowed_cmd_EXPORT[20] = // cmd #15 { - 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0 + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 }; -static u8 option_allowed_cmd_CAT[18] = // cmd #16 +static u8 option_allowed_cmd_CAT[20] = // cmd #16 { - 0,0,0,1,1, 0,1,1,0,0, 0,0,0,0,0, 0,1,0 + 0,0,0,1,1, 1,1,0,1,1, 0,0,0,0,0, 0,0,0,1,0 }; -static u8 option_allowed_cmd_DECODE[18] = // cmd #17 +static u8 option_allowed_cmd_DECODE[20] = // cmd #17 { - 0,0,0,1,1, 0,1,1,1,1, 1,1,1,1,1, 1,1,0 + 0,0,0,1,1, 1,1,0,1,1, 1,1,1,1,1, 1,1,1,1,0 }; -static u8 option_allowed_cmd_ENCODE[18] = // cmd #18 +static u8 option_allowed_cmd_ENCODE[20] = // cmd #18 { - 0,0,0,0,0, 0,1,1,1,1, 1,1,1,1,1, 1,1,0 + 0,0,0,0,0, 1,1,0,1,1, 1,1,1,1,1, 1,1,1,1,0 }; @@ -922,8 +939,10 @@ static const InfoOption_t * option_tab_cmd_ERROR[] = static const InfoOption_t * option_tab_cmd_FILETYPE[] = { - &option_cmd_FILETYPE_LONG, + OptionInfo + OPT_NO_WILDCARDS, + OptionInfo + OPT_IN_ORDER, OptionInfo + OPT_IGNORE, + &option_cmd_FILETYPE_LONG, 0 }; @@ -973,7 +992,12 @@ static const InfoOption_t * option_tab_cmd_EXPORT[] = static const InfoOption_t * option_tab_cmd_CAT[] = { + OptionInfo + OPT_NO_WILDCARDS, + OptionInfo + OPT_IN_ORDER, OptionInfo + OPT_IGNORE, + + OptionInfo + OPT_NONE, // separator + &option_grp_TEXTOUT_NO_HEADER, OptionInfo + OPT_BRIEF, OptionInfo + OPT_NO_ECHO, @@ -984,6 +1008,12 @@ static const InfoOption_t * option_tab_cmd_CAT[] = static const InfoOption_t * option_tab_cmd_DECODE[] = { + OptionInfo + OPT_NO_WILDCARDS, + OptionInfo + OPT_IN_ORDER, + OptionInfo + OPT_IGNORE, + + OptionInfo + OPT_NONE, // separator + OptionInfo + OPT_DEST, OptionInfo + OPT_DEST2, OptionInfo + OPT_ESC, @@ -996,7 +1026,6 @@ static const InfoOption_t * option_tab_cmd_DECODE[] = OptionInfo + OPT_REMOVE_DEST, OptionInfo + OPT_UPDATE, OptionInfo + OPT_PRESERVE, - OptionInfo + OPT_IGNORE, &option_grp_TEXTOUT_NO_HEADER, OptionInfo + OPT_BRIEF, OptionInfo + OPT_NO_ECHO, @@ -1007,6 +1036,12 @@ static const InfoOption_t * option_tab_cmd_DECODE[] = static const InfoOption_t * option_tab_cmd_ENCODE[] = { + OptionInfo + OPT_NO_WILDCARDS, + OptionInfo + OPT_IN_ORDER, + OptionInfo + OPT_IGNORE, + + OptionInfo + OPT_NONE, // separator + OptionInfo + OPT_DEST, OptionInfo + OPT_DEST2, OptionInfo + OPT_ESC, @@ -1021,7 +1056,6 @@ static const InfoOption_t * option_tab_cmd_ENCODE[] = OptionInfo + OPT_PRESERVE, OptionInfo + OPT_NO_ECHO, OptionInfo + OPT_NO_CHECK, - OptionInfo + OPT_IGNORE, 0 }; @@ -1126,10 +1160,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "This debug command accepts (like ARGTEST) all kinds of parameters and" " prints one line for each parameter. After that, the parameter is" " treated as a filename with wildcards and all matching files are" - " searched. The special parameters '+h' and '_h' enable or disable the" - " search for hidden directories and files (files beginning with a" - " point) for the following parameters. All tools know the EXPAND" - " command.", + " searched. All tools know the EXPAND command.", 0, 0, option_tab_cmd_EXPAND, @@ -1191,9 +1222,11 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "FT", "wpatt FILETYPE file...", "Scan the header of the entered files and print file type and path for" - " each file as list. All tools know the FILETYPE command.", + " each file as list. Wildcards and pipe characters are parsed, see" + " https://szs.wiimm.de/doc/wildcards for details. All tools know the" + " FILETYPE command.", 0, - 2, + 4, option_tab_cmd_FILETYPE, option_allowed_cmd_FILETYPE }, @@ -1307,10 +1340,11 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = 0, "wpatt CAT [source]...", "Read the entered PAT files (text or binary) and print them as decoded" - " text files to standard output (stdout). The output of all source" - " files is concatenated.", + " text files to standard output (stdout). Wildcards and pipe" + " characters are parsed, see https://szs.wiimm.de/doc/wildcards for" + " details. The output of all source files is concatenated.", 0, - 5, + 7, option_tab_cmd_CAT, option_allowed_cmd_CAT }, @@ -1323,9 +1357,11 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "DEC", "wpatt DECODE [source]...", "Read the entered PAT files (text or binary) and decode them to text" - " files. The default destination is '%P/%N.txt'.", + " files. Wildcards and pipe characters are parsed, see" + " https://szs.wiimm.de/doc/wildcards for details. The default" + " destination is '%P/%N.txt'.", 0, - 14, + 16, option_tab_cmd_DECODE, option_allowed_cmd_DECODE }, @@ -1338,9 +1374,11 @@ static const InfoCommand_t CommandInfo[CMD__N+1] = "ENC", "wpatt ENCODE [source]...", "Read the entered PAT files (text or binary) and encode (compile) them" - " to binary files. The default destination is '%P/%N.pat'.", + " to binary files. Wildcards and pipe characters are parsed, see" + " https://szs.wiimm.de/doc/wildcards for details. The default" + " destination is '%P/%N.pat'.", 0, - 12, + 14, option_tab_cmd_ENCODE, option_allowed_cmd_ENCODE }, -- cgit v1.3.1