mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
pactl: Remove deprecated 'stat' behaviour
the stat command should only output statistics, not info
behaviour was deprecated anno 2011 in 8ace9185 "pactl: Make stat backwards
compatible" -- fix this now
v2: (thanks Tanu Kaskinen):
* adjust shell completion
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
parent
31d5acdc78
commit
6d1fd4d1aa
4 changed files with 4 additions and 20 deletions
|
|
@ -66,11 +66,8 @@ USA.
|
||||||
<section name="Commands">
|
<section name="Commands">
|
||||||
|
|
||||||
<option>
|
<option>
|
||||||
<p><opt>stat</opt> [<arg>short</arg>]</p>
|
<p><opt>stat</opt></p>
|
||||||
<optdesc><p>Dump a few statistics about the memory usage of the PulseAudio daemon. (Note: for backwards
|
<optdesc><p>Dump a few statistics about the memory usage of the PulseAudio daemon.</p></optdesc>
|
||||||
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>
|
||||||
|
|
||||||
<option>
|
<option>
|
||||||
|
|
|
||||||
|
|
@ -179,8 +179,6 @@ _pactl() {
|
||||||
case $prev in
|
case $prev in
|
||||||
list) COMPREPLY=($(compgen -W '${list_types[*]}' -- "$cur")) ;;
|
list) COMPREPLY=($(compgen -W '${list_types[*]}' -- "$cur")) ;;
|
||||||
|
|
||||||
stat) COMPREPLY=($(compgen -W 'short' -- "$cur")) ;;
|
|
||||||
|
|
||||||
upload-sample) _filedir ;;
|
upload-sample) _filedir ;;
|
||||||
|
|
||||||
play-sample) ;; # TODO
|
play-sample) ;; # TODO
|
||||||
|
|
|
||||||
|
|
@ -465,7 +465,6 @@ _pactl_completion() {
|
||||||
_command=$words[1]
|
_command=$words[1]
|
||||||
|
|
||||||
case $_command in
|
case $_command in
|
||||||
stat) if ((CURRENT == 2)); then compadd short; fi;;
|
|
||||||
list) _list_parameter;;
|
list) _list_parameter;;
|
||||||
upload-sample) if ((CURRENT == 2)); then _files; fi;;
|
upload-sample) if ((CURRENT == 2)); then _files; fi;;
|
||||||
play-sample) _play_sample_parameter;;
|
play-sample) _play_sample_parameter;;
|
||||||
|
|
|
||||||
|
|
@ -1201,14 +1201,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case STAT:
|
case STAT:
|
||||||
o = pa_context_stat(c, stat_callback, NULL);
|
o = pa_context_stat(c, stat_callback, NULL);
|
||||||
if (short_list_format)
|
break;
|
||||||
break;
|
|
||||||
|
|
||||||
if (o) {
|
|
||||||
pa_operation_unref(o);
|
|
||||||
actions++;
|
|
||||||
}
|
|
||||||
/* Fall through */
|
|
||||||
|
|
||||||
case INFO:
|
case INFO:
|
||||||
o = pa_context_get_server_info(c, get_server_info_callback, NULL);
|
o = pa_context_get_server_info(c, get_server_info_callback, NULL);
|
||||||
|
|
@ -1563,7 +1556,7 @@ static enum mute_flags parse_mute(const char *mute_text) {
|
||||||
|
|
||||||
static void help(const char *argv0) {
|
static void help(const char *argv0) {
|
||||||
|
|
||||||
printf("%s %s %s\n", argv0, _("[options]"), "stat [short]");
|
printf("%s %s %s\n", argv0, _("[options]"), "stat");
|
||||||
printf("%s %s %s\n", argv0, _("[options]"), "info");
|
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\n", argv0, _("[options]"), "exit");
|
||||||
|
|
@ -1665,9 +1658,6 @@ int main(int argc, char *argv[]) {
|
||||||
if (optind < argc) {
|
if (optind < argc) {
|
||||||
if (pa_streq(argv[optind], "stat")) {
|
if (pa_streq(argv[optind], "stat")) {
|
||||||
action = 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;
|
action = INFO;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue