mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
pactl: Make stat backwards compatible with previous versions.
This is not ideal but in order to aid people using it in scripts etc, we will maintain backwards compatibiliy here. Also add a 'short' mode and mention in the man page that this will ultimately become the default at some point in the future.
This commit is contained in:
parent
49c20b3e3d
commit
8ace9185aa
2 changed files with 15 additions and 7 deletions
|
|
@ -66,8 +66,11 @@ USA.
|
|||
<section name="Commands">
|
||||
|
||||
<option>
|
||||
<p><opt>stat</opt></p>
|
||||
<optdesc><p>Dump a few statistics about the memory usage of the PulseAudio daemon.</p></optdesc>
|
||||
<p><opt>stat</opt> [short]</p>
|
||||
<optdesc><p>Dump a few statistics about the memory usage of the PulseAudio daemon. (Note: for backwards
|
||||
compatibility, we also show the output of the <arg>info</arg> command. In order to only show
|
||||
statistics, use the optional <arg>short</arg> argument. In a future version of PA we will
|
||||
make this the default)</p></optdesc>
|
||||
</option>
|
||||
|
||||
<option>
|
||||
|
|
|
|||
|
|
@ -1001,7 +1001,9 @@ static void context_state_callback(pa_context *c, void *userdata) {
|
|||
switch (action) {
|
||||
case STAT:
|
||||
pa_operation_unref(pa_context_stat(c, stat_callback, NULL));
|
||||
break;
|
||||
if (short_list_format)
|
||||
break;
|
||||
actions++;
|
||||
|
||||
case INFO:
|
||||
pa_operation_unref(pa_context_get_server_info(c, get_server_info_callback, NULL));
|
||||
|
|
@ -1251,9 +1253,9 @@ static int parse_volume(const char *vol_spec, pa_volume_t *vol, enum volume_flag
|
|||
|
||||
static void help(const char *argv0) {
|
||||
|
||||
printf("%s %s %s\n", argv0, _("[options]"), "stat");
|
||||
printf("%s %s %s\n", argv0, _("[options]"), "stat [short]");
|
||||
printf("%s %s %s\n", argv0, _("[options]"), "info");
|
||||
printf("%s %s %s %s\n", argv0, _("[options]"), "list", _("[short] [TYPE]"));
|
||||
printf("%s %s %s %s\n", argv0, _("[options]"), "list [short]", _("[TYPE]"));
|
||||
printf("%s %s %s\n", argv0, _("[options]"), "exit");
|
||||
printf("%s %s %s %s\n", argv0, _("[options]"), "upload-sample", _("FILENAME [NAME]"));
|
||||
printf("%s %s %s %s\n", argv0, _("[options]"), "play-sample ", _("NAME [SINK]"));
|
||||
|
|
@ -1344,10 +1346,13 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
if (optind < argc) {
|
||||
if (pa_streq(argv[optind], "stat"))
|
||||
if (pa_streq(argv[optind], "stat")) {
|
||||
action = STAT;
|
||||
short_list_format = FALSE;
|
||||
if (optind+1 < argc && pa_streq(argv[optind+1], "short"))
|
||||
short_list_format = TRUE;
|
||||
|
||||
else if (pa_streq(argv[optind], "info"))
|
||||
} else if (pa_streq(argv[optind], "info"))
|
||||
action = INFO;
|
||||
|
||||
else if (pa_streq(argv[optind], "exit"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue