swfから画像を抽出するコマンドラインアプリケーション
リビジョン | a04bd0a8edd7e0edbd02a1449afb243c655f872b (tree) |
---|---|
日時 | 2018-05-23 22:43:24 |
作者 | masakih <masakih@user...> |
コミッター | masakih |
s オプションを追加
s, silent 一切のメッセージを出力しない
@@ -26,17 +26,25 @@ static void usage(int exitVal, FILE *fp) { | ||
26 | 26 | fprintf(fp, "Usage: %s [OPTIONS] input-swf-file\n", toolName); |
27 | 27 | |
28 | 28 | fprintf(fp, "\n"); |
29 | + | |
29 | 30 | fprintf(fp, " -c charactorIDs, --charactorid=charactorIDs\n"); |
30 | - fprintf(fp, "\tcomma separated target image charactor ids. ex) 17,19 \n"); | |
31 | + fprintf(fp, "\tComma separated target image charactor ids. ex) 17,19 \n"); | |
31 | 32 | fprintf(fp, "\textract all images if not set.\n"); |
33 | + | |
32 | 34 | fprintf(fp, " -o output-directory, --output=output-directory\n"); |
33 | - fprintf(fp, "\textracted images output to output-directory.\n"); | |
35 | + fprintf(fp, "\tExtracted images output to output-directory.\n"); | |
36 | + | |
34 | 37 | fprintf(fp, " -v, --version\n"); |
35 | - fprintf(fp, "\toutput version information and exit.\n"); | |
38 | + fprintf(fp, "\tOutput version information and exit.\n"); | |
39 | + | |
36 | 40 | fprintf(fp, " -f, --force\n"); |
37 | - fprintf(fp, "\tif set, force orver write outputfile.\n"); | |
41 | + fprintf(fp, "\tIf set, force orver write outputfile.\n"); | |
42 | + | |
43 | + fprintf(fp, " -s, --silent\n"); | |
44 | + fprintf(fp, "\tSilent mode.\n"); | |
45 | + | |
38 | 46 | fprintf(fp, " -h, --help\n"); |
39 | - fprintf(fp, "\tdisplay this help and text.\n"); | |
47 | + fprintf(fp, "\tDisplay this help and text.\n"); | |
40 | 48 | |
41 | 49 | exit(exitVal); |
42 | 50 | } |
@@ -60,11 +68,12 @@ int main(int argc, char * const *argv) { | ||
60 | 68 | |
61 | 69 | toolName = toolNameStr(argv[0]); |
62 | 70 | |
63 | -#define SHORTOPTS "fho:vc:" | |
71 | +#define SHORTOPTS "fsho:vc:" | |
64 | 72 | static struct option longopts[] = { |
65 | 73 | {"output", required_argument, NULL, 'o'}, |
66 | 74 | {"charactorid", required_argument, NULL, 'c'}, |
67 | 75 | {"force", no_argument, NULL, 'f'}, |
76 | + {"silent", no_argument, NULL, 's'}, | |
68 | 77 | {"version", no_argument, NULL, 'v'}, |
69 | 78 | {"help", no_argument, NULL, 'h'}, |
70 | 79 | {NULL, 0, NULL, 0} |
@@ -82,6 +91,10 @@ int main(int argc, char * const *argv) { | ||
82 | 91 | case 'f': |
83 | 92 | forceOverwrite = YES; |
84 | 93 | break; |
94 | + case 's': | |
95 | + fclose(stdout); | |
96 | + fclose(stderr); | |
97 | + break; | |
85 | 98 | case 'h': |
86 | 99 | usage(EXIT_SUCCESS, stdout); |
87 | 100 | break; |