diff --git a/sndioctl/sndioctl.1 b/sndioctl/sndioctl.1 index 83306e6..34088d7 100644 --- a/sndioctl/sndioctl.1 +++ b/sndioctl/sndioctl.1 @@ -23,7 +23,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl dimnv +.Op Fl dimnqv .Op Fl f Ar device .Op Ar command ... .Ek @@ -49,6 +49,8 @@ instead of their values. Monitor and display audio parameter changes. .It Fl n Suppress printing of the variable name. +.It Fl q +Suppress all printing when setting a variable. .It Fl v Enable verbose mode, a.k.a. multi-channel mode. By default parameters affecting different channels diff --git a/sndioctl/sndioctl.c b/sndioctl/sndioctl.c index 6dce3e9..a800c90 100644 --- a/sndioctl/sndioctl.c +++ b/sndioctl/sndioctl.c @@ -64,7 +64,7 @@ void onctl(void *, unsigned, unsigned); struct sioctl_hdl *hdl; struct info *infolist; -int i_flag = 0, v_flag = 0, m_flag = 0, n_flag = 0; +int i_flag = 0, v_flag = 0, m_flag = 0, n_flag = 0, q_flag = 0; static inline int isname_first(int c) @@ -855,7 +855,7 @@ main(int argc, char **argv) struct pollfd *pfds; int nfds, revents; - while ((c = getopt(argc, argv, "df:imnv")) != -1) { + while ((c = getopt(argc, argv, "df:imnqv")) != -1) { switch (c) { case 'd': d_flag = 1; @@ -872,12 +872,15 @@ main(int argc, char **argv) case 'n': n_flag = 1; break; + case 'q': + q_flag = 1; + break; case 'v': v_flag++; break; default: fprintf(stderr, "usage: sndioctl " - "[-dimnv] [-f device] [command ...]\n"); + "[-dimnqv] [-f device] [command ...]\n"); exit(1); } } @@ -913,7 +916,8 @@ main(int argc, char **argv) } } commit(); - list(); + if (!q_flag) + list(); } if (m_flag) { pfds = malloc(sizeof(struct pollfd) * sioctl_nfds(hdl));