Skip to content

Commit

Permalink
helpを追加。
Browse files Browse the repository at this point in the history
  • Loading branch information
rigaya committed May 24, 2019
1 parent c4e03f8 commit 10a6d42
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ before_build:
$version = $env:APPVEYOR_BUILD_VERSION + '_Alpha'
}
$env:BUILD_VERSION=$version
- cd ..\

build:
project: build/hdr10plus_gen.sln
Expand Down
14 changes: 12 additions & 2 deletions hdr10plus_gen/hdr10plus_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
#include <string>
#include "hdr10plus.h"

using namespace std;
static const char *EXE_VER = "0.00";

void print_help() {
std::cerr << "hdr10plus_gen v" << EXE_VER << std::endl;
std::cerr << "Usage:" << std::endl;
std::cerr << " hdr10plus_gen.exe -i <input json file> -o <output binary>" << std::endl;
}

int main(int argc, char **argv) {
std::string inputFile;
Expand All @@ -20,10 +26,14 @@ int main(int argc, char **argv) {
} else if (std::string(argv[iarg]) == "-o") {
iarg++;
outputFile = argv[iarg];
} else if (std::string(argv[iarg]) == "-h") {
print_help();
return 1;
}
}
if (inputFile.length() == 0) {
std::cerr << "input file not specified!" << std::endl;
print_help();
return 1;
}
if (outputFile.length() == 0) {
Expand All @@ -36,7 +46,7 @@ int main(int argc, char **argv) {
return 1;
}
}
unique_ptr<FILE, decltype(&fclose)> fp(outputFile == "-" ? stdout : fopen(outputFile.c_str(), "wb"), fclose);
std::unique_ptr<FILE, decltype(&fclose)> fp(outputFile == "-" ? stdout : fopen(outputFile.c_str(), "wb"), fclose);

const auto hdr10plus = hdr10plus_api_get();
if (hdr10plus == nullptr) {
Expand Down

0 comments on commit 10a6d42

Please sign in to comment.