Skip to content

Commit

Permalink
If only invalid input types specified, tga files will be processed. I…
Browse files Browse the repository at this point in the history
…nput types may now also be specified in a single argument as a comma-separated list (or in multiple like before). The new long-form option is --in instead of --intype.
  • Loading branch information
bluescan committed Aug 6, 2023
1 parent 3c98ae6 commit b8eeea4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Src/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Command
tCmdLine::tOption OptionSyntax ("Print syntax help", "syntax", 's' );
tCmdLine::tOption OptionVerbosity ("Verbosity from 0 to 2", "verbosity", 'v', 1 );

tCmdLine::tOption OptionInTypes ("Input file type(s)", "intype", 'i', 1 );
tCmdLine::tOption OptionInTypes ("Input file type(s)", "in", 'i', 1 );
tCmdLine::tOption OptionOperation ("Operation", "op", 1 );
tCmdLine::tOption OptionPostOperation ("Post operation", "po", 1 );

Expand Down Expand Up @@ -217,6 +217,14 @@ void Command::DetermineInputTypes()
InputTypes.Add(ft);
}
}

// If InputTypes is still empty because the caller didn't enter any valid types, we
// default to tga-only.
if (InputTypes.IsEmpty())
{
tPrintfNorm("Warning: No valid input types specified. Defaulting to tga.\n");
InputTypes.Add(tSystem::tFileType::TGA);
}
}
else
{
Expand Down Expand Up @@ -879,7 +887,8 @@ more than one accepted extension (tif and tiff). The extension is not
specified, the type is. Use the --in (-i) option to specify one or more input
types. You may have more than one -i to process multiple types or you may
specify multiple types with a comma-separated list. For example, '-i jpg,png'
is the same as '-i jpg -i png'.
is the same as '-i jpg -i png'. If you specify only unsupported or invalid
types a warning is generated and tga images will be processed.
%s
%s
Expand Down

0 comments on commit b8eeea4

Please sign in to comment.