summaryrefslogtreecommitdiff
path: root/bat
diff options
context:
space:
mode:
authorLu, Han <han.lu@intel.com>2015-10-20 16:45:47 +0800
committerTakashi Iwai <tiwai@suse.de>2015-10-20 11:06:24 +0200
commit5a48606d940c9676309b766592f84fb64e1da73d (patch)
tree067dba61a6e5fb8df60c71623ad524a8766ebfb2 /bat
parent8c910830f0b93e8956d0662017aae394cb3d9561 (diff)
downloadalsa-utils-5a48606d940c9676309b766592f84fb64e1da73d.tar.gz
BAT: Change comments and interface of usage()
1. Change comment strings to make the descriptions more clear; 2. Add indent for option lines that have no indent; 3. Use a const string instead of argv[0] as program name. Signed-off-by: Lu, Han <han.lu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'bat')
-rw-r--r--bat/bat.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/bat/bat.c b/bat/bat.c
index dd34505..de32a6d 100644
--- a/bat/bat.c
+++ b/bat/bat.c
@@ -268,28 +268,27 @@ static void test_capture(struct bat *bat)
}
}
-static void usage(struct bat *bat, char *argv[])
+static void usage(struct bat *bat)
{
fprintf(bat->log,
-_("Usage:%s [Option]...\n"
+_("Usage: bat [-options]...\n"
"\n"
-"-h, --help help\n"
-"-D sound card\n"
-"-P playback pcm\n"
-"-C capture pcm\n"
-"-f sample size\n"
-"-c number of channels\n"
-"-r sampling rate\n"
-"-n frames to capture\n"
-"-k sigma k\n"
-"-F target frequency\n"
-"-p total number of periods to play/capture\n"
-" --log=# path of log file. if not set, logs be put to stdout,\n"
-" and errors be put to stderr.\n"
-" --file=# input file\n"
-" --saveplay=# save playback content to target file, for debug\n"
-" --local internal loop, bypass hardware\n"
-), argv[0]);
+" -h, --help this help\n"
+" -D pcm device for both playback and capture\n"
+" -P pcm device for playback\n"
+" -C pcm device for capture\n"
+" -f sample format\n"
+" -c number of channels\n"
+" -r sampling rate\n"
+" -n frames to playback or capture\n"
+" -k parameter for frequency detecting threshold\n"
+" -F target frequency\n"
+" -p total number of periods to play/capture\n"
+" --log=# file that both stdout and strerr redirecting to\n"
+" --file=# file for playback\n"
+" --saveplay=# file that storing playback content, for debug\n"
+" --local internal loop, set to bypass pcm hardware devices\n"
+));
fprintf(bat->log, _("Recognized sample formats are: %s %s %s %s\n"),
snd_pcm_format_name(SND_PCM_FORMAT_U8),
snd_pcm_format_name(SND_PCM_FORMAT_S16_LE),
@@ -401,7 +400,7 @@ static void parse_arguments(struct bat *bat, int argc, char *argv[])
break;
case 'h':
default:
- usage(bat, argv);
+ usage(bat);
exit(EXIT_SUCCESS);
}
}