mirror of https://github.com/ericonr/sndio.git
sndioctl: Add -q option to suppress output when setting variables
This commit is contained in:
parent
2254b715af
commit
a04ab3f18c
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue