[PATCH 4/6] pacmd: Select quiet mode in stdin is not a terminal or have command-line commands to execute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
---
 src/utils/pacmd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/utils/pacmd.c b/src/utils/pacmd.c
index 7dd3c9b..02b457d 100644
--- a/src/utils/pacmd.c
+++ b/src/utils/pacmd.c
@@ -83,9 +83,9 @@ static void help(const char *argv0) {
 
     printf(_("\n"
          "  -h, --help                            Show this help\n"
-         "      --version                         Show version\n"
          "      --quiet                           Don't show welcome message\n"
-         "When no command is given pacmd starts in the interactive mode\n" ));
+         "      --version                         Show version\n"
+         "When no command is given pacmd starts in the interactive mode.\n" ));
 }
 
 enum {
@@ -220,6 +220,9 @@ int main(int argc, char*argv[]) {
         ibuf_eof = true;
     }
 
+    if (ibuf_eof || !isatty(STDIN_FILENO))
+        quiet = true;
+
     /* wait for initial welcome */
     for (;;) {
         struct pollfd *p;
-- 
1.8.3.2



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux