Merge pull request #95 from zeux/fix-extension
Don't append .basis extension in basisu_comp.cpp
diff --git a/basisu_tool.cpp b/basisu_tool.cpp
index 4003a01..0123a76 100644
--- a/basisu_tool.cpp
+++ b/basisu_tool.cpp
@@ -35,7 +35,8 @@
cCompress,
cValidate,
cUnpack,
- cCompare
+ cCompare,
+ cVersion,
};
static void print_usage()
@@ -47,6 +48,7 @@
" -unpack: Use transcoder to unpack .basis file to one or more .ktx/.png files\n"
" -validate: Validate and display information about a .basis file\n"
" -compare: Compare two PNG images specified with -file, output PSNR and SSIM statistics and RGB/A delta images\n"
+ " -version: Print basisu version and exit\n"
"Unless an explicit mode is specified, if one or more files have the .basis extension this tool defaults to unpack mode.\n"
"\n"
"Important: By default, the compressor assumes the input is in the sRGB colorspace (like photos/albedo textures).\n"
@@ -250,6 +252,8 @@
m_mode = cUnpack;
else if (strcasecmp(pArg, "-validate") == 0)
m_mode = cValidate;
+ else if (strcasecmp(pArg, "-version") == 0)
+ m_mode = cVersion;
else if (strcasecmp(pArg, "-compare_ssim") == 0)
m_compare_ssim = true;
else if (strcasecmp(pArg, "-file") == 0)
@@ -1507,6 +1511,9 @@
case cCompare:
status = compare_mode(opts);
break;
+ case cVersion:
+ status = true; // We printed the version at the beginning of main_internal
+ break;
default:
assert(0);
break;