Merge pull request #626 from naxostech/StrDraco

Add version string output to cli tools.

When -v is passed to draco_decoder or draco_encoder, the version is printed and the
tool will exit.
This commit is contained in:
Tom Finegan 2020-12-08 12:45:07 -08:00 committed by GitHub
commit 359048ea86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -15,6 +15,7 @@
#include <cinttypes>
#include "draco/compression/decode.h"
#include "draco/core/draco_version.h"
#include "draco/core/cycle_timer.h"
#include "draco/io/file_utils.h"
#include "draco/io/obj_encoder.h"
@ -55,6 +56,9 @@ int main(int argc, char **argv) {
if (!strcmp("-h", argv[i]) || !strcmp("-?", argv[i])) {
Usage();
return 0;
} else if (!strcmp("-v", argv[i])) {
printf("draco_decoder version: %s\n", draco::Version());
return 0;
} else if (!strcmp("-i", argv[i]) && i < argc_check) {
options.input = argv[++i];
} else if (!strcmp("-o", argv[i]) && i < argc_check) {

View File

@ -16,6 +16,7 @@
#include <cstdlib>
#include "draco/compression/encode.h"
#include "draco/core/draco_version.h"
#include "draco/core/cycle_timer.h"
#include "draco/io/file_utils.h"
#include "draco/io/mesh_io.h"
@ -195,6 +196,9 @@ int main(int argc, char **argv) {
if (!strcmp("-h", argv[i]) || !strcmp("-?", argv[i])) {
Usage();
return 0;
} else if (!strcmp("-v", argv[i])) {
printf("draco_encoder version: %s\n", draco::Version());
return 0;
} else if (!strcmp("-i", argv[i]) && i < argc_check) {
options.input = argv[++i];
} else if (!strcmp("-o", argv[i]) && i < argc_check) {