Added longopts to tuxrecord.
This commit is contained in:
parent
3ff9ea07f5
commit
16b0ee3ec9
2 changed files with 14 additions and 14 deletions
20
tuxrecord.c
20
tuxrecord.c
|
|
@ -120,12 +120,12 @@ static void usage(void)
|
|||
" tuxrecord [options]\n"
|
||||
"\n"
|
||||
"OPTIONS\n"
|
||||
" -o <dir> Output directory (default: current directory)\n"
|
||||
" -d <secs> Stop automatically after <secs> seconds (default: until q or Ctrl+C)\n"
|
||||
" -p <prefix> Filename prefix instead of \"%s\" (default: %s)\n"
|
||||
" -D <device> ALSA capture device (default: \"%s\")\n"
|
||||
" -f, --format <fmt> Output format: wav, flac or mp3 (default: wav)\n"
|
||||
" -h, --help Show this help\n"
|
||||
" -o, --output <dir> Output directory (default: current directory)\n"
|
||||
" -d, --duration <secs> Stop automatically after <secs> seconds (default: until q or Ctrl+C)\n"
|
||||
" -p, --prefix <prefix> Filename prefix instead of \"%s\" (default: %s)\n"
|
||||
" -D, --device <device> ALSA capture device (default: \"%s\")\n"
|
||||
" -f, --format <fmt> Output format: wav, flac or mp3 (default: wav)\n"
|
||||
" -h, --help Show this help\n"
|
||||
"\n"
|
||||
"The file is written as <prefix>__<timestamp>.<ext> where <ext> is wav,\n"
|
||||
"flac or mp3 depending on -f/--format\n"
|
||||
|
|
@ -1030,13 +1030,13 @@ int main(int argc, char **argv)
|
|||
i = 1;
|
||||
while (i < argc) {
|
||||
const char *a = argv[i];
|
||||
if (strcmp(a, "-o") == 0) {
|
||||
if (strcmp(a, "-o") == 0 || strcmp(a, "--output") == 0) {
|
||||
if (++i >= argc) {
|
||||
usage();
|
||||
return 2;
|
||||
}
|
||||
output_dir = argv[i];
|
||||
} else if (strcmp(a, "-d") == 0) {
|
||||
} else if (strcmp(a, "-d") == 0 || strcmp(a, "--duration") == 0) {
|
||||
char *end = NULL;
|
||||
double d;
|
||||
if (++i >= argc) {
|
||||
|
|
@ -1049,13 +1049,13 @@ int main(int argc, char **argv)
|
|||
return 2;
|
||||
}
|
||||
duration = d;
|
||||
} else if (strcmp(a, "-p") == 0) {
|
||||
} else if (strcmp(a, "-p") == 0 || strcmp(a, "--prefix") == 0) {
|
||||
if (++i >= argc || argv[i][0] == '\0') {
|
||||
usage();
|
||||
return 2;
|
||||
}
|
||||
prefix = argv[i];
|
||||
} else if (strcmp(a, "-D") == 0) {
|
||||
} else if (strcmp(a, "-D") == 0 || strcmp(a, "--device") == 0) {
|
||||
if (++i >= argc || argv[i][0] == '\0') {
|
||||
usage();
|
||||
return 2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue