소스 검색

Added version command line option.

master
Svend Sorensen 19 년 전
부모
커밋
0e53f7ef35
6개의 변경된 파일69개의 추가작업 그리고 3개의 파일을 삭제
  1. +4
    -0
      doc/cuebreakpoints.1
  2. +4
    -0
      doc/cueconvert.1
  3. +4
    -0
      doc/cueprint.1
  4. +19
    -1
      src/tools/cuebreakpoints.c
  5. +19
    -1
      src/tools/cueconvert.c
  6. +19
    -1
      src/tools/cueprint.c

+ 4
- 0
doc/cuebreakpoints.1 파일 보기

@@ -31,6 +31,10 @@ prefix pregaps to track
.B \--split-gaps
split at beginning and end of pregaps
.
.TP
.B \--version
print version information
.
.SH NOTES
The breakpoints are in a format usable by shnsplit (part of the shntool package).
.PP


+ 4
- 0
doc/cueconvert.1 파일 보기

@@ -23,6 +23,10 @@ set format of input file
.B \-o, \--output-format cue|toc
set format of output file
.
.TP
.B \--version
print version information
.
.SH NOTES
If infile or outfile is not specified, stdin and stdout are used, respectively. If a filename is specified and the format is not specified, the format will be set based on a ".cue" or ".toc" suffix. If the output file format is not specified, and it cannot be determined from the suffix, it will be set to the opposite of the input format.
.


+ 4
- 0
doc/cueprint.1 파일 보기

@@ -31,6 +31,10 @@ set disc template (see TEMPLATE EXPANSION)
.B \-t, \--track-template <template>
set track template (see TEMPLATE EXPANSION)
.
.TP
.B \--version
print version information
.
.SH TEMPLATE EXPANSION
All characters in the template are reproduced in the output except for conversions, which begin with `%'.
.PP


+ 19
- 1
src/tools/cuebreakpoints.c 파일 보기

@@ -12,6 +12,12 @@
#include "cuefile.h"
#include "time.h"

#if HAVE_CONFIG_H
#include "config.h"
#else
#define PACKAGE_STRING "cuebreakpoints"
#endif

char *progname;

/* pregap correction modes
@@ -33,6 +39,7 @@ OPTIONS\n\
--append-gaps append pregaps to previous track (default)\n\
--prepend-gaps prefix pregaps to track\n\
--split-gaps split at beginning and end of pregaps\n\
-V, --version print version information\n\
", stdout);
} else {
fprintf(stderr, "run `%s --help' for usage\n", progname);
@@ -41,6 +48,13 @@ OPTIONS\n\
exit (status);
}

void version ()
{
printf("%s\n", PACKAGE_STRING);

exit(0);
}

void print_m_ss_ff (long frame)
{
int m, s, f;
@@ -119,12 +133,13 @@ int main (int argc, char **argv)
{"append-gaps", no_argument, NULL, 'a'},
{"prepend-gaps", no_argument, NULL, 'p'},
{"split-gaps", no_argument, NULL, 's'},
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
};

progname = *argv;

while (-1 != (c = getopt_long(argc, argv, "hi:", longopts, NULL))) {
while (-1 != (c = getopt_long(argc, argv, "hi:V", longopts, NULL))) {
switch (c) {
case 'h':
usage(0);
@@ -148,6 +163,9 @@ int main (int argc, char **argv)
case 's':
gaps = SPLIT;
break;
case 'V':
version();
break;
default:
usage(1);
break;


+ 19
- 1
src/tools/cueconvert.c 파일 보기

@@ -11,6 +11,12 @@
#include <getopt.h>
#include "cuefile.h"

#if HAVE_CONFIG_H
#include "config.h"
#else
#define PACKAGE_STRING "cuebreakpoints"
#endif

char *progname;

void usage (int status)
@@ -23,6 +29,7 @@ OPTIONS\n\
-h, --help print usage\n\
-i, --input-format cue|toc set format of input file\n\
-o, --output-format cue|toc set format of output file\n\
-V, --version print version information\n\
", stdout);
} else {
fprintf(stderr, "run `%s --help' for usage\n", progname);
@@ -31,6 +38,13 @@ OPTIONS\n\
exit (status);
}

void version ()
{
printf("%s\n", PACKAGE_STRING);

exit(0);
}

int convert (char *iname, int iformat, char *oname, int oformat)
{
Cd *cd = NULL;
@@ -72,12 +86,13 @@ int main (int argc, char **argv)
{"help", no_argument, NULL, 'h'},
{"input-format", required_argument, NULL, 'i'},
{"output-format", required_argument, NULL, 'o'},
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
};

progname = *argv;

while (-1 != (c = getopt_long(argc, argv, "hi:o:", longopts, NULL))) {
while (-1 != (c = getopt_long(argc, argv, "hi:o:V", longopts, NULL))) {
switch (c) {
case 'h':
usage(0);
@@ -102,6 +117,9 @@ int main (int argc, char **argv)
usage(1);
}
break;
case 'V':
version();
break;
default:
usage(1);
break;


+ 19
- 1
src/tools/cueprint.c 파일 보기

@@ -12,6 +12,12 @@
#include <ctype.h> /* isdigit() */
#include "cuefile.h"

#if HAVE_CONFIG_H
#include "config.h"
#else
#define PACKAGE_STRING "cuebreakpoints"
#endif

/* default templates */

#define D_TEMPLATE "\
@@ -67,6 +73,7 @@ OPTIONS\n\
-n, --track-number <number> only print track information for single track\n\
-d, --disc-template <template> set disc template (see TEMPLATE EXPANSION)\n\
-t, --track-template <template> set track template (see TEMPLATE EXPANSION)\n\
-V, --version print version information\n\
\n\
Template Expansion\n\
Disc:\n\
@@ -103,6 +110,13 @@ Any other %<character> is expanded to that character. For example, to get a\n\
exit (status);
}

void version ()
{
printf("%s\n", PACKAGE_STRING);

exit(0);
}

void disc_field (char *conv, int length, Cd *cd, Value *value)
{
char *c; /* pointer to conversion character */
@@ -435,12 +449,13 @@ int main (int argc, char **argv)
{"track-number", required_argument, NULL, 'n'},
{"disc-template", required_argument, NULL, 'd'},
{"track-template", required_argument, NULL, 't'},
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
};

progname = *argv;

while (-1 != (c = getopt_long(argc, argv, "hi:n:d:t:", longopts, NULL))) {
while (-1 != (c = getopt_long(argc, argv, "hi:n:d:t:V", longopts, NULL))) {
switch (c) {
case 'h':
usage(0);
@@ -464,6 +479,9 @@ int main (int argc, char **argv)
case 't':
t_template = optarg;
break;
case 'V':
version();
break;
default:
usage(1);
break;


불러오는 중...
취소
저장