From b7b9357964d4b23ed50d561d99684d9085221826 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Sat, 11 Apr 2015 13:21:11 -0700 Subject: [PATCH] Add help command line option --- CLTool/src/tc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CLTool/src/tc.cpp b/CLTool/src/tc.cpp index 3ac67ee..87b16f3 100644 --- a/CLTool/src/tc.cpp +++ b/CLTool/src/tc.cpp @@ -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 \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++;