1 /* metaflac - Command-line FLAC metadata editor
2 * Copyright (C) 2001 Josh Coalson
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 static int usage(const char *message, ...);
29 int main(int argc, char *argv[])
31 bool verbose, list_mode;
37 for(i = 1; i < argc; i++) {
38 if(argv[i][0] != '-' || argv[i][1] == 0)
40 if(0 == strcmp(argv[i], "-l"))
42 else if(0 == strcmp(argv[i], "-v"))
44 else if(0 == strcmp(argv[i], "-v-"))
47 return usage("ERROR: invalid option '%s'\n", argv[i]);
50 if(i + (list_mode? 1:2) != argc)
51 return usage("ERROR: invalid arguments (more/less than %d filename%s?)\n", (list_mode? 1:2), (list_mode? "":"s"));
56 int usage(const char *message, ...)
61 va_start(args, message);
63 (void) vfprintf(stderr, message, args);
68 printf("==============================================================================\n");
69 printf("metaflac - Command-line FLAC metadata editor version %s\n", FLAC__VERSION_STRING);
70 printf("Copyright (C) 2001 Josh Coalson\n");
72 printf("This program is free software; you can redistribute it and/or\n");
73 printf("modify it under the terms of the GNU General Public License\n");
74 printf("as published by the Free Software Foundation; either version 2\n");
75 printf("of the License, or (at your option) any later version.\n");
77 printf("This program is distributed in the hope that it will be useful,\n");
78 printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n");
79 printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n");
80 printf("GNU General Public License for more details.\n");
82 printf("You should have received a copy of the GNU General Public License\n");
83 printf("along with this program; if not, write to the Free Software\n");
84 printf("Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n");
85 printf("==============================================================================\n");
87 printf(" metaflac [options] infile [outfile]\n");
90 printf(" -l : list metadata blocks\n");
91 printf(" -v : verbose\n");
92 printf(" -v- can all be used to turn off a particular option\n");