Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
SupMover - Shift timings and Screen Area of PGS/Sup subtitle

# Usage

Version information:

SupMover --version
SupMover version

```
Usage: SupMover <input.sup> [<output.sup>] [OPTIONS ...]

Expand Down
6 changes: 4 additions & 2 deletions cmd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,11 @@ bool parseCMD(int32_t argc, char** argv, t_cmd& cmd) {
}


#define SUPMOVER_VERSION "2.5.1"

const char* usageHelp =
R"_(SupMover v2.5.1
Usage: SupMover <input.sup> [<output.sup>] [OPTIONS ...]
"SupMover v" SUPMOVER_VERSION "\n"
R"_(Usage: SupMover <input.sup> [<output.sup>] [OPTIONS ...]

OPTIONS:
--trace
Expand Down
7 changes: 7 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ int main(int32_t argc, char** argv)
size_t size, newSize;
t_header header;

if (argc == 2 &&
(std::strcmp(argv[1], "--version") == 0 ||
std::strcmp(argv[1], "version") == 0)) {
std::printf("SupMover v%s\n", SUPMOVER_VERSION);
return 0;
}

if (argc < 3) {
std::fprintf(stderr, "%s", usageHelp);
return -1;
Expand Down