Add help command line option

This commit is contained in:
Pavel Krajcevski 2015-04-11 13:21:11 -07:00
parent e7b3a1d390
commit b7b9357964

View file

@ -75,6 +75,7 @@
void PrintUsage() {
fprintf(stderr, "Usage: tc [OPTIONS] imagefile\n");
fprintf(stderr, "\n");
fprintf(stderr, "\t-h|--help\tPrint this help.\n");
fprintf(stderr, "\t-v\t\tVerbose mode: prints out Entropy, Mean Local Entropy, and MSSIM\n");
fprintf(stderr, "\t-f <fmt>\tFormat to use. Either \"BPTC\", \"ETC1\", \"DXT1\", \"DXT5\", or \"PVRTC\". Default: BPTC\n");
fprintf(stderr, "\t-l\t\tSave an output log.\n");
@ -181,6 +182,11 @@ int main(int argc, char **argv) {
continue;
}
if (strcmp(argv[fileArg], "-h") == 0 || strcmp(argv[fileArg], "--help") == 0) {
PrintUsage();
exit(0);
}
if (strcmp(argv[fileArg], "-d") == 0) {
fileArg++;