aboutsummaryrefslogtreecommitdiff
path: root/project/src/ui/ui-wimgt.c
diff options
context:
space:
mode:
authorWiimm <wiimm@wiimm.de>2021-04-07 11:00:18 +0200
committerWiimm <wiimm@wiimm.de>2021-04-07 11:00:18 +0200
commit9ccd762ee98823e8de27e294ce8b63e3eb8f2f9b (patch)
treeae586b532aa92608ba963cfd11f4987c582ef4a1 /project/src/ui/ui-wimgt.c
parenta9415225000b204931f04d602f81780e1d3f06c4 (diff)
SZS 2.24a
Diffstat (limited to '')
-rw-r--r--project/src/ui/ui-wimgt.c137
1 files changed, 92 insertions, 45 deletions
diff --git a/project/src/ui/ui-wimgt.c b/project/src/ui/ui-wimgt.c
index 0fae748..b2742d6 100644
--- a/project/src/ui/ui-wimgt.c
+++ b/project/src/ui/ui-wimgt.c
@@ -276,6 +276,15 @@ static const InfoOption_t OptionInfo[OPT__N_TOTAL+1] =
" commands included. Exit after printing."
},
+ { OPT_CONFIG, false, false, false, false, false, 0, "config",
+ "file",
+ "Define a configuration file or a directory as source. In later case,"
+ " file 'wiimms-szs-tools.conf' is searched.\n"
+ " If option is not not set, then file 'wiimms-szs-tools.conf' is"
+ " searched in different directories. Use command 'wszst CONFIG' to get"
+ " more details."
+ },
+
{ OPT_ALLOW_ALL, false, false, false, false, false, 0, "allow-all",
0,
"Usually commands accept only options with impact to the command. All"
@@ -473,7 +482,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 == 55
+ {0,0,0,0,0,0,0,0,0,0} // OPT__N_TOTAL == 56
};
@@ -495,6 +504,12 @@ static const InfoOption_t option_cmd_VERSION_LONG =
"Print in long format. Ignored if option --sections is set."
};
+static const InfoOption_t option_cmd_CONFIG_LONG =
+ { OPT_LONG, false, false, false, false, false, 'l', "long",
+ 0,
+ "If set, print the search list too."
+ };
+
static const InfoOption_t option_cmd_COLORS_LONG =
{ OPT_LONG, false, false, false, false, false, 'l', "long",
0,
@@ -554,6 +569,7 @@ static const KeywordTab_t CommandTab[] =
{ CMD_VERSION, "VERSION", 0, 0 },
{ CMD_HELP, "HELP", "H", 0 },
{ CMD_HELP, "?", 0, 0 },
+ { CMD_CONFIG, "CONFIG", 0, 0 },
{ CMD_ARGTEST, "ARGTEST", 0, 0 },
{ CMD_TEST, "TEST", 0, 0 },
{ CMD_COLORS, "COLORS", 0, 0 },
@@ -585,6 +601,7 @@ static const struct option OptionLong[] =
{ "version", 0, 0, 'V' },
{ "help", 0, 0, 'h' },
{ "xhelp", 0, 0, GO_XHELP },
+ { "config", 1, 0, GO_CONFIG },
{ "allow-all", 0, 0, GO_ALLOW_ALL },
{ "allowall", 0, 0, GO_ALLOW_ALL },
{ "compatible", 1, 0, GO_COMPATIBLE },
@@ -725,36 +742,37 @@ static const OptionIndex_t OptionIndex[UIOPT_INDEX_SIZE] =
/* 0x078 x */ OPT_TRANSFORM,
/* 0x079 */ 0,0,0,0, 0,0,0,
/* 0x080 */ OPT_XHELP,
- /* 0x081 */ OPT_ALLOW_ALL,
- /* 0x082 */ OPT_COMPATIBLE,
- /* 0x083 */ OPT_WIDTH,
- /* 0x084 */ OPT_MAX_WIDTH,
- /* 0x085 */ OPT_DE,
- /* 0x086 */ OPT_COLORS,
- /* 0x087 */ OPT_NO_COLORS,
- /* 0x088 */ OPT_CT_CODE,
- /* 0x089 */ OPT_LE_CODE,
- /* 0x08a */ OPT_CHDIR,
- /* 0x08b */ OPT_UTF_8,
- /* 0x08c */ OPT_NO_UTF_8,
- /* 0x08d */ OPT_FORCE,
- /* 0x08e */ OPT_REPAIR_MAGICS,
- /* 0x08f */ OPT_OLD,
- /* 0x090 */ OPT_STD,
- /* 0x091 */ OPT_NEW,
- /* 0x092 */ OPT_EXTRACT,
- /* 0x093 */ OPT_NUMBER,
- /* 0x094 */ OPT_MIPMAPS,
- /* 0x095 */ OPT_NO_MIPMAPS,
- /* 0x096 */ OPT_N_MIPMAPS,
- /* 0x097 */ OPT_MAX_MIPMAPS,
- /* 0x098 */ OPT_MIPMAP_SIZE,
- /* 0x099 */ OPT_FAST_MIPMAPS,
- /* 0x09a */ OPT_CMPR_DEFAULT,
- /* 0x09b */ OPT_PRE_CONVERT,
- /* 0x09c */ OPT_STRIP,
- /* 0x09d */ OPT_SECTIONS,
- /* 0x09e */ 0,0,
+ /* 0x081 */ OPT_CONFIG,
+ /* 0x082 */ OPT_ALLOW_ALL,
+ /* 0x083 */ OPT_COMPATIBLE,
+ /* 0x084 */ OPT_WIDTH,
+ /* 0x085 */ OPT_MAX_WIDTH,
+ /* 0x086 */ OPT_DE,
+ /* 0x087 */ OPT_COLORS,
+ /* 0x088 */ OPT_NO_COLORS,
+ /* 0x089 */ OPT_CT_CODE,
+ /* 0x08a */ OPT_LE_CODE,
+ /* 0x08b */ OPT_CHDIR,
+ /* 0x08c */ OPT_UTF_8,
+ /* 0x08d */ OPT_NO_UTF_8,
+ /* 0x08e */ OPT_FORCE,
+ /* 0x08f */ OPT_REPAIR_MAGICS,
+ /* 0x090 */ OPT_OLD,
+ /* 0x091 */ OPT_STD,
+ /* 0x092 */ OPT_NEW,
+ /* 0x093 */ OPT_EXTRACT,
+ /* 0x094 */ OPT_NUMBER,
+ /* 0x095 */ OPT_MIPMAPS,
+ /* 0x096 */ OPT_NO_MIPMAPS,
+ /* 0x097 */ OPT_N_MIPMAPS,
+ /* 0x098 */ OPT_MAX_MIPMAPS,
+ /* 0x099 */ OPT_MIPMAP_SIZE,
+ /* 0x09a */ OPT_FAST_MIPMAPS,
+ /* 0x09b */ OPT_CMPR_DEFAULT,
+ /* 0x09c */ OPT_PRE_CONVERT,
+ /* 0x09d */ OPT_STRIP,
+ /* 0x09e */ OPT_SECTIONS,
+ /* 0x09f */ 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,
@@ -782,67 +800,72 @@ static u8 option_allowed_cmd_HELP[26] = // 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
};
-static u8 option_allowed_cmd_ARGTEST[26] = // cmd #3
+static u8 option_allowed_cmd_CONFIG[26] = // cmd #3
+{
+ 0,1,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_ARGTEST[26] = // 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
};
-static u8 option_allowed_cmd_TEST[26] = // cmd #4
+static u8 option_allowed_cmd_TEST[26] = // 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
};
-static u8 option_allowed_cmd_COLORS[26] = // cmd #5
+static u8 option_allowed_cmd_COLORS[26] = // cmd #6
{
0,1,0,1,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_ERROR[26] = // cmd #6
+static u8 option_allowed_cmd_ERROR[26] = // cmd #7
{
0,1,1,1,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 1
};
-static u8 option_allowed_cmd_FILETYPE[26] = // cmd #7
+static u8 option_allowed_cmd_FILETYPE[26] = // cmd #8
{
0,1,0,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0
};
-static u8 option_allowed_cmd_FILEATTRIB[26] = // cmd #8
+static u8 option_allowed_cmd_FILEATTRIB[26] = // cmd #9
{
0,0,1,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_LIST[26] = // cmd #9
+static u8 option_allowed_cmd_LIST[26] = // cmd #10
{
0,1,1,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0
};
-static u8 option_allowed_cmd_LIST_L[26] = // cmd #10
+static u8 option_allowed_cmd_LIST_L[26] = // cmd #11
{
0,1,1,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0
};
-static u8 option_allowed_cmd_LIST_LL[26] = // cmd #11
+static u8 option_allowed_cmd_LIST_LL[26] = // cmd #12
{
0,1,1,0,0, 0,0,0,0,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0, 0
};
-static u8 option_allowed_cmd_DECODE[26] = // cmd #12
+static u8 option_allowed_cmd_DECODE[26] = // cmd #13
{
0,0,0,0,1, 1,1,1,1,1, 1,1,1,0,1, 1,1,1,1,1, 1,1,1,1,1, 0
};
-static u8 option_allowed_cmd_ENCODE[26] = // cmd #13
+static u8 option_allowed_cmd_ENCODE[26] = // cmd #14
{
0,0,0,0,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0
};
-static u8 option_allowed_cmd_CONVERT[26] = // cmd #14
+static u8 option_allowed_cmd_CONVERT[26] = // cmd #15
{
0,0,0,0,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0
};
-static u8 option_allowed_cmd_COPY[26] = // cmd #15
+static u8 option_allowed_cmd_COPY[26] = // cmd #16
{
0,0,0,0,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 0
};
@@ -858,6 +881,7 @@ static const InfoOption_t * option_tab_tool[] =
OptionInfo + OPT_VERSION,
OptionInfo + OPT_HELP,
OptionInfo + OPT_XHELP,
+ OptionInfo + OPT_CONFIG,
OptionInfo + OPT_ALLOW_ALL,
OptionInfo + OPT_COMPATIBLE,
OptionInfo + OPT_WIDTH,
@@ -900,6 +924,14 @@ static const InfoOption_t * option_tab_cmd_HELP[] =
0
};
+static const InfoOption_t * option_tab_cmd_CONFIG[] =
+{
+ OptionInfo + OPT_CONFIG,
+ &option_cmd_CONFIG_LONG,
+
+ 0
+};
+
static const InfoOption_t * option_tab_cmd_ARGTEST[] =
{
@@ -1135,7 +1167,7 @@ static const InfoCommand_t CommandInfo[CMD__N+1] =
"Wiimms Image Tool : Extract and convert graphic images. The file"
" formats TPL, TEX, BTI, BREFT and PNG are supported.",
0,
- 21,
+ 22,
option_tab_tool,
0
},
@@ -1178,6 +1210,21 @@ static const InfoCommand_t CommandInfo[CMD__N+1] =
option_allowed_cmd_HELP
},
+ { CMD_CONFIG,
+ false,
+ false,
+ false,
+ "CONFIG",
+ 0,
+ "wimgt CONFIG [options]...",
+ "Show all information about the search for the configuration file and"
+ " its content.",
+ 0,
+ 2,
+ option_tab_cmd_CONFIG,
+ option_allowed_cmd_CONFIG
+ },
+
{ CMD_ARGTEST,
false,
false,