|
47 | 47 | #include <getopt.h>
|
48 | 48 | #include <assert.h>
|
49 | 49 | #include <stdio.h>
|
| 50 | +#include <filesystem> |
50 | 51 | #include "common.h"
|
51 | 52 |
|
52 | 53 |
|
@@ -91,17 +92,25 @@ static const char* fourcc_to_string(uint32_t fourcc)
|
91 | 92 |
|
92 | 93 | void show_help(const char* argv0)
|
93 | 94 | {
|
94 |
| - fprintf(stderr, " heif-info libheif version: %s\n", heif_get_version()); |
95 |
| - fprintf(stderr, "------------------------------------\n"); |
96 |
| - fprintf(stderr, "usage: heif-info [options] image.heic\n"); |
97 |
| - fprintf(stderr, "\n"); |
98 |
| - fprintf(stderr, "options:\n"); |
99 |
| - //fprintf(stderr," -w, --write-raw ID write raw compressed data of image 'ID'\n"); |
100 |
| - //fprintf(stderr," -o, --output NAME output file name for image selected by -w\n"); |
101 |
| - fprintf(stderr, " -d, --dump-boxes show a low-level dump of all MP4 file boxes\n"); |
102 |
| - fprintf(stderr, " --disable-limits disable all security limits (do not use in production environment)\n"); |
103 |
| - fprintf(stderr, " -h, --help show help\n"); |
104 |
| - fprintf(stderr, " -v, --version show version\n"); |
| 95 | + std::filesystem::path p(argv0); |
| 96 | + std::string filename = p.filename().string(); |
| 97 | + |
| 98 | + std::stringstream sstr; |
| 99 | + sstr << " " << filename << " libheif version: " << heif_get_version(); |
| 100 | + |
| 101 | + std::string title = sstr.str(); |
| 102 | + |
| 103 | + std::cerr << title << "\n" |
| 104 | + << std::string(title.length() + 1, '-') << "\n" |
| 105 | + << "Usage: " << filename << " [options] <HEIF-image>\n" |
| 106 | + << "\n" |
| 107 | + "options:\n" |
| 108 | + //fprintf(stderr," -w, --write-raw ID write raw compressed data of image 'ID'\n"); |
| 109 | + //fprintf(stderr," -o, --output NAME output file name for image selected by -w\n"); |
| 110 | + " -d, --dump-boxes show a low-level dump of all MP4 file boxes\n" |
| 111 | + " --disable-limits disable all security limits (do not use in production environment)\n" |
| 112 | + " -h, --help show help\n" |
| 113 | + " -v, --version show version\n"; |
105 | 114 | }
|
106 | 115 |
|
107 | 116 |
|
|
0 commit comments