/src/flac/src/metaflac/usage.c
Line | Count | Source |
1 | | /* metaflac - Command-line FLAC metadata editor |
2 | | * Copyright (C) 2001-2009 Josh Coalson |
3 | | * Copyright (C) 2011-2025 Xiph.Org Foundation |
4 | | * |
5 | | * This program is free software; you can redistribute it and/or |
6 | | * modify it under the terms of the GNU General Public License |
7 | | * as published by the Free Software Foundation; either version 2 |
8 | | * of the License, or (at your option) any later version. |
9 | | * |
10 | | * This program is distributed in the hope that it will be useful, |
11 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | | * GNU General Public License for more details. |
14 | | * |
15 | | * You should have received a copy of the GNU General Public License along |
16 | | * with this program; if not, write to the Free Software Foundation, Inc., |
17 | | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
18 | | */ |
19 | | |
20 | | #ifdef HAVE_CONFIG_H |
21 | | # include <config.h> |
22 | | #endif |
23 | | |
24 | | #include "utils.h" |
25 | | #include "usage.h" |
26 | | #include "FLAC/format.h" |
27 | | #include <stdarg.h> |
28 | | #include <stdio.h> |
29 | | #include "share/compat.h" |
30 | | |
31 | | static void usage_header(FILE *out) |
32 | 2.40k | { |
33 | 2.40k | flac_fprintf(out, "==============================================================================\n"); |
34 | 2.40k | flac_fprintf(out, "metaflac - Command-line FLAC metadata editor version %s\n", FLAC__VERSION_STRING); |
35 | 2.40k | flac_fprintf(out, "Copyright (C) 2001-2009 Josh Coalson\n"); |
36 | 2.40k | flac_fprintf(out, "Copyright (C) 2011-2025 Xiph.Org Foundation\n"); |
37 | 2.40k | flac_fprintf(out, "\n"); |
38 | 2.40k | flac_fprintf(out, "This program is free software; you can redistribute it and/or\n"); |
39 | 2.40k | flac_fprintf(out, "modify it under the terms of the GNU General Public License\n"); |
40 | 2.40k | flac_fprintf(out, "as published by the Free Software Foundation; either version 2\n"); |
41 | 2.40k | flac_fprintf(out, "of the License, or (at your option) any later version.\n"); |
42 | 2.40k | flac_fprintf(out, "\n"); |
43 | 2.40k | flac_fprintf(out, "This program is distributed in the hope that it will be useful,\n"); |
44 | 2.40k | flac_fprintf(out, "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); |
45 | 2.40k | flac_fprintf(out, "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); |
46 | 2.40k | flac_fprintf(out, "GNU General Public License for more details.\n"); |
47 | 2.40k | flac_fprintf(out, "\n"); |
48 | 2.40k | flac_fprintf(out, "You should have received a copy of the GNU General Public License along\n"); |
49 | 2.40k | flac_fprintf(out, "with this program; if not, write to the Free Software Foundation, Inc.,\n"); |
50 | 2.40k | flac_fprintf(out, "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n"); |
51 | 2.40k | flac_fprintf(out, "==============================================================================\n"); |
52 | 2.40k | } |
53 | | |
54 | | static void usage_summary(FILE *out) |
55 | 2.40k | { |
56 | 2.40k | flac_fprintf(out, "Usage:\n"); |
57 | 2.40k | flac_fprintf(out, " metaflac [options] [operations] FLACfile [FLACfile ...]\n"); |
58 | 2.40k | flac_fprintf(out, "\n"); |
59 | 2.40k | flac_fprintf(out, "Use metaflac to list, add, remove, or edit metadata in one or more FLAC files.\n"); |
60 | 2.40k | flac_fprintf(out, "You may perform one major operation, or many shorthand operations at a time.\n"); |
61 | 2.40k | flac_fprintf(out, "\n"); |
62 | 2.40k | flac_fprintf(out, "Options:\n"); |
63 | 2.40k | flac_fprintf(out, "-o, --output-name=FILENAME Write changes to a new file, instead of doing all\n"); |
64 | 2.40k | flac_fprintf(out, " operations on the input files\n"); |
65 | 2.40k | flac_fprintf(out, "--preserve-modtime Preserve the original modification time in spite of edits\n"); |
66 | 2.40k | flac_fprintf(out, " This option does nothing when combined with --output-name\n"); |
67 | 2.40k | flac_fprintf(out, "--with-filename Prefix each output line with the FLAC file name\n"); |
68 | 2.40k | flac_fprintf(out, " (the default if more than one FLAC file is specified).\n"); |
69 | 2.40k | flac_fprintf(out, " This option has no effect for options exporting to a\n"); |
70 | 2.40k | flac_fprintf(out, " file, like --export-tags-to.\n"); |
71 | 2.40k | flac_fprintf(out, "--no-filename Do not prefix each output line with the FLAC file name\n"); |
72 | 2.40k | flac_fprintf(out, " (the default if only one FLAC file is specified)\n"); |
73 | 2.40k | flac_fprintf(out, "--no-utf8-convert Do not convert tags from UTF-8 to local charset,\n"); |
74 | 2.40k | flac_fprintf(out, " or vice versa. This is useful for scripts, and setting\n"); |
75 | 2.40k | flac_fprintf(out, " tags in situations where the locale is wrong.\n"); |
76 | 2.40k | flac_fprintf(out, "--dont-use-padding By default metaflac tries to use padding where possible\n"); |
77 | 2.40k | flac_fprintf(out, " to avoid rewriting the entire file if the metadata size\n"); |
78 | 2.40k | flac_fprintf(out, " changes. Use this option to tell metaflac to not take\n"); |
79 | 2.40k | flac_fprintf(out, " advantage of padding this way.\n"); |
80 | 2.40k | } |
81 | | |
82 | | int short_usage(const char *message, ...) |
83 | 2.39k | { |
84 | 2.39k | va_list args; |
85 | | |
86 | 2.39k | if(message) { |
87 | 0 | va_start(args, message); |
88 | |
|
89 | 0 | (void) flac_vfprintf(stderr, message, args); |
90 | |
|
91 | 0 | va_end(args); |
92 | |
|
93 | 0 | } |
94 | 2.39k | usage_header(stderr); |
95 | 2.39k | flac_fprintf(stderr, "\n"); |
96 | 2.39k | flac_fprintf(stderr, "This is the short help; for full help use 'metaflac --help'\n"); |
97 | 2.39k | flac_fprintf(stderr, "\n"); |
98 | 2.39k | usage_summary(stderr); |
99 | | |
100 | 2.39k | return message? 1 : 0; |
101 | 2.39k | } |
102 | | |
103 | | int long_usage(const char *message, ...) |
104 | 7 | { |
105 | 7 | FILE *out = (message? stderr : stdout); |
106 | 7 | va_list args; |
107 | | |
108 | 7 | if(message) { |
109 | 0 | va_start(args, message); |
110 | |
|
111 | 0 | (void) flac_vfprintf(stderr, message, args); |
112 | |
|
113 | 0 | va_end(args); |
114 | |
|
115 | 0 | } |
116 | 7 | usage_header(out); |
117 | 7 | flac_fprintf(out, "\n"); |
118 | 7 | usage_summary(out); |
119 | 7 | flac_fprintf(out, "\n"); |
120 | 7 | flac_fprintf(out, "Shorthand operations:\n"); |
121 | 7 | flac_fprintf(out, "--show-md5sum Show the MD5 signature from the STREAMINFO block.\n"); |
122 | 7 | flac_fprintf(out, "--show-min-blocksize Show the minimum block size from the STREAMINFO block.\n"); |
123 | 7 | flac_fprintf(out, "--show-max-blocksize Show the maximum block size from the STREAMINFO block.\n"); |
124 | 7 | flac_fprintf(out, "--show-min-framesize Show the minimum frame size from the STREAMINFO block.\n"); |
125 | 7 | flac_fprintf(out, "--show-max-framesize Show the maximum frame size from the STREAMINFO block.\n"); |
126 | 7 | flac_fprintf(out, "--show-sample-rate Show the sample rate from the STREAMINFO block.\n"); |
127 | 7 | flac_fprintf(out, "--show-channels Show the number of channels from the STREAMINFO block.\n"); |
128 | 7 | flac_fprintf(out, "--show-bps Show the # of bits per sample from the STREAMINFO block.\n"); |
129 | 7 | flac_fprintf(out, "--show-total-samples Show the total # of samples from the STREAMINFO block.\n"); |
130 | 7 | flac_fprintf(out, "\n"); |
131 | 7 | flac_fprintf(out, "--show-vendor-tag Show the vendor string from the VORBIS_COMMENT block.\n"); |
132 | 7 | flac_fprintf(out, "--show-tag=NAME Show all tags where the field name matches 'NAME'.\n"); |
133 | 7 | flac_fprintf(out, "--show-all-tags Show all tags. This is an alias for --export-tags-to=-.\n"); |
134 | 7 | flac_fprintf(out, "--remove-tag=NAME Remove all tags whose field name is 'NAME'.\n"); |
135 | 7 | flac_fprintf(out, "--remove-first-tag=NAME Remove first tag whose field name is 'NAME'.\n"); |
136 | 7 | flac_fprintf(out, "--remove-all-tags Remove all tags, leaving only the vendor string.\n"); |
137 | 7 | flac_fprintf(out, "--remove-all-tags-except=NAME1[=NAME2[=...]] Remove all tags, except the vendor\n"); |
138 | 7 | flac_fprintf(out, " string and the tag names specified. Tag names must be\n"); |
139 | 7 | flac_fprintf(out, " separated by an = character.\n"); |
140 | 7 | flac_fprintf(out, "--set-tag=FIELD Add a tag. The FIELD must comply with the Vorbis comment\n"); |
141 | 7 | flac_fprintf(out, " spec, of the form \"NAME=VALUE\". If there is currently\n"); |
142 | 7 | flac_fprintf(out, " no tag block, one will be created.\n"); |
143 | 7 | flac_fprintf(out, "--set-tag-from-file=FIELD Like --set-tag, except the VALUE is a filename\n"); |
144 | 7 | flac_fprintf(out, " whose contents will be read verbatim to set the tag value.\n"); |
145 | 7 | flac_fprintf(out, " Unless --no-utf8-convert is specified, the contents will\n"); |
146 | 7 | flac_fprintf(out, " be converted to UTF-8 from the local charset. This can\n"); |
147 | 7 | flac_fprintf(out, " be used to store a cuesheet in a tag (e.g.\n"); |
148 | 7 | flac_fprintf(out, " --set-tag-from-file=\"CUESHEET=image.cue\"). Do not try\n"); |
149 | 7 | flac_fprintf(out, " to store binary data in tag fields! Use APPLICATION\n"); |
150 | 7 | flac_fprintf(out, " blocks for that.\n"); |
151 | 7 | flac_fprintf(out, "--import-tags-from=FILE Import tags from a file. Use '-' for stdin. Each line\n"); |
152 | 7 | flac_fprintf(out, " should be of the form NAME=VALUE. Multi-line comments\n"); |
153 | 7 | flac_fprintf(out, " are currently not supported. Specify --remove-all-tags\n"); |
154 | 7 | flac_fprintf(out, " and/or --no-utf8-convert before --import-tags-from if\n"); |
155 | 7 | flac_fprintf(out, " necessary. If FILE is '-' (stdin), only one FLAC file\n"); |
156 | 7 | flac_fprintf(out, " may be specified.\n"); |
157 | 7 | flac_fprintf(out, "--export-tags-to=FILE Export tags to a file. Use '-' for stdout. Each line\n"); |
158 | 7 | flac_fprintf(out, " will be of the form NAME=VALUE. Specify\n"); |
159 | 7 | flac_fprintf(out, " --no-utf8-convert if necessary.\n"); |
160 | 7 | flac_fprintf(out, "--import-cuesheet-from=FILE Import a cuesheet from a file. Use '-' for stdin.\n"); |
161 | 7 | flac_fprintf(out, " Only one FLAC file may be specified. A seekpoint will be\n"); |
162 | 7 | flac_fprintf(out, " added for each index point in the cuesheet to the\n"); |
163 | 7 | flac_fprintf(out, " SEEKTABLE unless --no-cued-seekpoints is specified.\n"); |
164 | 7 | flac_fprintf(out, "--export-cuesheet-to=FILE Export CUESHEET block to a cuesheet file, suitable\n"); |
165 | 7 | flac_fprintf(out, " for use by CD authoring software. Use '-' for stdout.\n"); |
166 | 7 | flac_fprintf(out, " Only one FLAC file may be specified on the command line.\n"); |
167 | 7 | flac_fprintf(out, "--import-picture-from=FILENAME|SPECIFICATION Import a picture and store it in a\n"); |
168 | 7 | flac_fprintf(out, " PICTURE block. Either a filename for the picture file or\n"); |
169 | 7 | flac_fprintf(out, " a more complete specification form can be used. The\n"); |
170 | 7 | flac_fprintf(out, " SPECIFICATION is a string whose parts are separated by |\n"); |
171 | 7 | flac_fprintf(out, " characters. Some parts may be left empty to invoke\n"); |
172 | 7 | flac_fprintf(out, " default values. FILENAME is just shorthand for\n"); |
173 | 7 | flac_fprintf(out, " \"||||FILENAME\". The format of SPECIFICATION is:\n"); |
174 | 7 | flac_fprintf(out, " [TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILE\n"); |
175 | 7 | flac_fprintf(out, " TYPE is optional; it is a number from one of:\n"); |
176 | 7 | flac_fprintf(out, " 0: Other\n"); |
177 | 7 | flac_fprintf(out, " 1: 32x32 pixels 'file icon' (PNG only)\n"); |
178 | 7 | flac_fprintf(out, " 2: Other file icon\n"); |
179 | 7 | flac_fprintf(out, " 3: Cover (front)\n"); |
180 | 7 | flac_fprintf(out, " 4: Cover (back)\n"); |
181 | 7 | flac_fprintf(out, " 5: Leaflet page\n"); |
182 | 7 | flac_fprintf(out, " 6: Media (e.g. label side of CD)\n"); |
183 | 7 | flac_fprintf(out, " 7: Lead artist/lead performer/soloist\n"); |
184 | 7 | flac_fprintf(out, " 8: Artist/performer\n"); |
185 | 7 | flac_fprintf(out, " 9: Conductor\n"); |
186 | 7 | flac_fprintf(out, " 10: Band/Orchestra\n"); |
187 | 7 | flac_fprintf(out, " 11: Composer\n"); |
188 | 7 | flac_fprintf(out, " 12: Lyricist/text writer\n"); |
189 | 7 | flac_fprintf(out, " 13: Recording Location\n"); |
190 | 7 | flac_fprintf(out, " 14: During recording\n"); |
191 | 7 | flac_fprintf(out, " 15: During performance\n"); |
192 | 7 | flac_fprintf(out, " 16: Movie/video screen capture\n"); |
193 | 7 | flac_fprintf(out, " 17: A bright coloured fish\n"); |
194 | 7 | flac_fprintf(out, " 18: Illustration\n"); |
195 | 7 | flac_fprintf(out, " 19: Band/artist logotype\n"); |
196 | 7 | flac_fprintf(out, " 20: Publisher/Studio logotype\n"); |
197 | 7 | flac_fprintf(out, " The default is 3 (front cover). There may only be one picture each\n"); |
198 | 7 | flac_fprintf(out, " of type 1 and 2 in a file.\n"); |
199 | 7 | flac_fprintf(out, " MIME-TYPE is optional; if left blank, it will be detected from the\n"); |
200 | 7 | flac_fprintf(out, " file. For best compatibility with players, use pictures with MIME\n"); |
201 | 7 | flac_fprintf(out, " type image/jpeg or image/png. The MIME type can also be --> to\n"); |
202 | 7 | flac_fprintf(out, " mean that FILE is actually a URL to an image, though this use is\n"); |
203 | 7 | flac_fprintf(out, " discouraged.\n"); |
204 | 7 | flac_fprintf(out, " DESCRIPTION is optional; the default is an empty string\n"); |
205 | 7 | flac_fprintf(out, " The next part specifies the resolution and color information. If\n"); |
206 | 7 | flac_fprintf(out, " the MIME-TYPE is image/jpeg, image/png, or image/gif, you can\n"); |
207 | 7 | flac_fprintf(out, " usually leave this empty and they can be detected from the file.\n"); |
208 | 7 | flac_fprintf(out, " Otherwise, you must specify the width in pixels, height in pixels,\n"); |
209 | 7 | flac_fprintf(out, " and color depth in bits-per-pixel. If the image has indexed colors\n"); |
210 | 7 | flac_fprintf(out, " you should also specify the number of colors used.\n"); |
211 | 7 | flac_fprintf(out, " FILE is the path to the picture file to be imported, or the URL if\n"); |
212 | 7 | flac_fprintf(out, " MIME type is -->\n"); |
213 | 7 | flac_fprintf(out, "--export-picture-to=FILE Export PICTURE block to a file. Use '-' for stdout.\n"); |
214 | 7 | flac_fprintf(out, " Only one FLAC file may be specified. The first PICTURE\n"); |
215 | 7 | flac_fprintf(out, " block will be exported unless --export-picture-to is\n"); |
216 | 7 | flac_fprintf(out, " preceded by a --block-number=# option to specify the exact\n"); |
217 | 7 | flac_fprintf(out, " metadata block to extract. Note that the block number is\n"); |
218 | 7 | flac_fprintf(out, " the one shown by --list.\n"); |
219 | 7 | flac_fprintf(out, "--add-replay-gain Calculates the title and album gains/peaks of the given\n"); |
220 | 7 | flac_fprintf(out, " FLAC files as if all the files were part of one album,\n"); |
221 | 7 | flac_fprintf(out, " then stores them in the VORBIS_COMMENT block. The tags\n"); |
222 | 7 | flac_fprintf(out, " are the same as those used by vorbisgain. Existing\n"); |
223 | 7 | flac_fprintf(out, " ReplayGain tags will be replaced. If only one FLAC file\n"); |
224 | 7 | flac_fprintf(out, " is given, the album and title gains will be the same.\n"); |
225 | 7 | flac_fprintf(out, " Since this operation requires two passes, it is always\n"); |
226 | 7 | flac_fprintf(out, " executed last, after all other operations have been\n"); |
227 | 7 | flac_fprintf(out, " completed and written to disk. All FLAC files specified\n"); |
228 | 7 | flac_fprintf(out, " must have the same resolution, sample rate, and number\n"); |
229 | 7 | flac_fprintf(out, " of channels. Only mono and stereo files are allowed,\n"); |
230 | 7 | flac_fprintf(out, " and the sample rate must be 8, 11.025, 12, 16, 18.9,\n"); |
231 | 7 | flac_fprintf(out, " 22.05, 24, 28, 32, 36, 37.8, 44.1, 48, 56, 64, 72, 75.6,\n"); |
232 | 7 | flac_fprintf(out, " 88.2, 96, 112, 128, 144, 151.2, 176.4, 192, 224, 256,\n"); |
233 | 7 | flac_fprintf(out, " 288, 302.4, 352.8, 384, 448, 512, 576, or 604.8 kHz.\n"); |
234 | 7 | flac_fprintf(out, "--scan-replay-gain Like --add-replay-gain, but only analyzes the files\n"); |
235 | 7 | flac_fprintf(out, " rather than writing them to tags.\n"); |
236 | 7 | flac_fprintf(out, "--remove-replay-gain Removes the ReplayGain tags.\n"); |
237 | 7 | flac_fprintf(out, "--add-seekpoint={#|X|#x|#s} Add seek points to a SEEKTABLE block\n"); |
238 | 7 | flac_fprintf(out, " # : a specific sample number for a seek point\n"); |
239 | 7 | flac_fprintf(out, " X : a placeholder point (always goes at the end of the SEEKTABLE)\n"); |
240 | 7 | flac_fprintf(out, " #x : # evenly spaced seekpoints, the first being at sample 0\n"); |
241 | 7 | flac_fprintf(out, " #s : a seekpoint every # seconds; # does not have to be a whole number\n"); |
242 | 7 | flac_fprintf(out, " If no SEEKTABLE block exists, one will be created. If\n"); |
243 | 7 | flac_fprintf(out, " one already exists, points will be added to the existing\n"); |
244 | 7 | flac_fprintf(out, " table, and any duplicates will be turned into placeholder\n"); |
245 | 7 | flac_fprintf(out, " points. You may use many --add-seekpoint options; the\n"); |
246 | 7 | flac_fprintf(out, " resulting SEEKTABLE will be the unique-ified union of\n"); |
247 | 7 | flac_fprintf(out, " all such values. Example: --add-seekpoint=100x\n"); |
248 | 7 | flac_fprintf(out, " --add-seekpoint=3.5s will add 100 evenly spaced\n"); |
249 | 7 | flac_fprintf(out, " seekpoints and a seekpoint every 3.5 seconds.\n"); |
250 | 7 | flac_fprintf(out, "--add-padding=length Add a padding block of the given length (in bytes).\n"); |
251 | 7 | flac_fprintf(out, " The overall length of the new block will be 4 + length;\n"); |
252 | 7 | flac_fprintf(out, " the extra 4 bytes is for the metadata block header.\n"); |
253 | 7 | flac_fprintf(out, "\n"); |
254 | 7 | flac_fprintf(out, "Major operations:\n"); |
255 | 7 | flac_fprintf(out, "--version\n"); |
256 | 7 | flac_fprintf(out, " Show the metaflac version number.\n"); |
257 | 7 | flac_fprintf(out, "--list\n"); |
258 | 7 | flac_fprintf(out, " List the contents of one or more metadata blocks to stdout. By default,\n"); |
259 | 7 | flac_fprintf(out, " all metadata blocks are listed in text format. Use the following options\n"); |
260 | 7 | flac_fprintf(out, " to change this behavior:\n"); |
261 | 7 | flac_fprintf(out, "\n"); |
262 | 7 | flac_fprintf(out, " --block-number=#[,#[...]]\n"); |
263 | 7 | flac_fprintf(out, " An optional comma-separated list of block numbers to display. The first\n"); |
264 | 7 | flac_fprintf(out, " block, the STREAMINFO block, is block 0.\n"); |
265 | 7 | flac_fprintf(out, "\n"); |
266 | 7 | flac_fprintf(out, " --block-type=type[,type[...]]\n"); |
267 | 7 | flac_fprintf(out, " --except-block-type=type[,type[...]]\n"); |
268 | 7 | flac_fprintf(out, " An optional comma-separated list of block types to be included or ignored\n"); |
269 | 7 | flac_fprintf(out, " with this option. Use only one of --block-type or --except-block-type.\n"); |
270 | 7 | flac_fprintf(out, " The valid block types are: STREAMINFO, PADDING, APPLICATION, SEEKTABLE,\n"); |
271 | 7 | flac_fprintf(out, " VORBIS_COMMENT. You may narrow down the types of APPLICATION blocks\n"); |
272 | 7 | flac_fprintf(out, " displayed as follows:\n"); |
273 | 7 | flac_fprintf(out, " APPLICATION:abcd The APPLICATION block(s) whose textual repre-\n"); |
274 | 7 | flac_fprintf(out, " sentation of the 4-byte ID is \"abcd\"\n"); |
275 | 7 | flac_fprintf(out, " APPLICATION:0xXXXXXXXX The APPLICATION block(s) whose hexadecimal big-\n"); |
276 | 7 | flac_fprintf(out, " endian representation of the 4-byte ID is\n"); |
277 | 7 | flac_fprintf(out, " \"0xXXXXXXXX\". For the example \"abcd\" above the\n"); |
278 | 7 | flac_fprintf(out, " hexadecimal equivalalent is 0x61626364\n"); |
279 | 7 | flac_fprintf(out, "\n"); |
280 | 7 | flac_fprintf(out, " NOTE: if both --block-number and --[except-]block-type are specified,\n"); |
281 | 7 | flac_fprintf(out, " the result is the logical AND of both arguments.\n"); |
282 | 7 | flac_fprintf(out, "\n"); |
283 | 7 | flac_fprintf(out, " --data-format=binary|binary-headerless|text\n"); |
284 | 7 | flac_fprintf(out, " By default a human-readable text representation of the data is displayed.\n"); |
285 | 7 | flac_fprintf(out, " You may specify --data-format=binary to dump the raw binary form of each\n"); |
286 | 7 | flac_fprintf(out, " metadata block. Specify --data-format=binary-headerless to omit output of\n"); |
287 | 7 | flac_fprintf(out, " metadata block headers, including the id of APPLICATION metadata blocks.\n"); |
288 | 7 | flac_fprintf(out, " The output can be read in using a subsequent call to\n"); |
289 | 7 | flac_fprintf(out, " \"metaflac --append\"\n"); |
290 | 7 | flac_fprintf(out, "\n"); |
291 | 7 | flac_fprintf(out, " --application-data-format=hexdump|text\n"); |
292 | 7 | flac_fprintf(out, " If the application block you are displaying contains binary data but your\n"); |
293 | 7 | flac_fprintf(out, " --data-format=text, you can display a hex dump of the application data\n"); |
294 | 7 | flac_fprintf(out, " contents instead using --application-data-format=hexdump\n"); |
295 | 7 | flac_fprintf(out, "\n"); |
296 | 7 | flac_fprintf(out, "--append\n"); |
297 | 7 | flac_fprintf(out, " Insert a metadata block from a file. This must be a binary block as\n"); |
298 | 7 | flac_fprintf(out, " exported with --list --data-format=binary. The insertion point is\n"); |
299 | 7 | flac_fprintf(out, " defined with --block-number=#. The new block will be added after the\n"); |
300 | 7 | flac_fprintf(out, " given block number. This prevents the illegal insertion of a block\n"); |
301 | 7 | flac_fprintf(out, " before the first STREAMINFO block. You may not --append another\n"); |
302 | 7 | flac_fprintf(out, " STREAMINFO block. It is possible to copy a metadata block from one\n"); |
303 | 7 | flac_fprintf(out, " file to another with this option. For example use\n"); |
304 | 7 | flac_fprintf(out, " metaflac --list --data-format=binary --block-number=6 file.flac > block\n"); |
305 | 7 | flac_fprintf(out, " to export the block, and then import it with\n"); |
306 | 7 | flac_fprintf(out, " metaflac --append anotherfile.flac < block\n"); |
307 | 7 | flac_fprintf(out, " Insert a metadata block from a file. The input file must be in the same\n"); |
308 | 7 | flac_fprintf(out, " format as generated with --list.\n"); |
309 | 7 | flac_fprintf(out, "\n"); |
310 | 7 | flac_fprintf(out, " --block-number=#\n"); |
311 | 7 | flac_fprintf(out, " Specify the insertion point (defaults to last block). The new block will\n"); |
312 | 7 | flac_fprintf(out, " be added after the given block number. This prevents the illegal insertion\n"); |
313 | 7 | flac_fprintf(out, " of a block before the first STREAMINFO block. You may not --append another\n"); |
314 | 7 | flac_fprintf(out, " STREAMINFO block.\n"); |
315 | 7 | flac_fprintf(out, "\n"); |
316 | | #if 0 |
317 | | /*@@@ not implemented yet */ |
318 | | flac_fprintf(out, " --from-file=filename\n"); |
319 | | flac_fprintf(out, " Mandatory 'option' to specify the input file containing the block contents.\n"); |
320 | | flac_fprintf(out, "\n"); |
321 | | flac_fprintf(out, " --data-format=binary|text\n"); |
322 | | flac_fprintf(out, " By default the block contents are assumed to be in binary format. You can\n"); |
323 | | flac_fprintf(out, " override this by specifying --data-format=text\n"); |
324 | | flac_fprintf(out, "\n"); |
325 | | #endif |
326 | 7 | flac_fprintf(out, "--remove\n"); |
327 | 7 | flac_fprintf(out, " Remove one or more metadata blocks from the metadata. Unless\n"); |
328 | 7 | flac_fprintf(out, " --dont-use-padding is specified, the blocks will be replaced with padding.\n"); |
329 | 7 | flac_fprintf(out, " You may not remove the STREAMINFO block.\n"); |
330 | 7 | flac_fprintf(out, "\n"); |
331 | 7 | flac_fprintf(out, " --block-number=#[,#[...]]\n"); |
332 | 7 | flac_fprintf(out, " --block-type=type[,type[...]]\n"); |
333 | 7 | flac_fprintf(out, " --except-block-type=type[,type[...]]\n"); |
334 | 7 | flac_fprintf(out, " See --list above for usage.\n"); |
335 | 7 | flac_fprintf(out, "\n"); |
336 | 7 | flac_fprintf(out, " NOTE: if both --block-number and --[except-]block-type are specified,\n"); |
337 | 7 | flac_fprintf(out, " the result is the logical AND of both arguments.\n"); |
338 | 7 | flac_fprintf(out, "\n"); |
339 | 7 | flac_fprintf(out, "--remove-all\n"); |
340 | 7 | flac_fprintf(out, " Remove all metadata blocks (except the STREAMINFO block) from the\n"); |
341 | 7 | flac_fprintf(out, " metadata. Unless --dont-use-padding is specified, the blocks will be\n"); |
342 | 7 | flac_fprintf(out, " replaced with padding.\n"); |
343 | 7 | flac_fprintf(out, "\n"); |
344 | 7 | flac_fprintf(out, "--merge-padding\n"); |
345 | 7 | flac_fprintf(out, " Merge adjacent PADDING blocks into single blocks.\n"); |
346 | 7 | flac_fprintf(out, "\n"); |
347 | 7 | flac_fprintf(out, "--sort-padding\n"); |
348 | 7 | flac_fprintf(out, " Move all PADDING blocks to the end of the metadata and merge them into a\n"); |
349 | 7 | flac_fprintf(out, " single block.\n"); |
350 | | |
351 | 7 | return message? 1 : 0; |
352 | 7 | } |