chiark / gitweb /
journalctl: skip informational messages in export/json modes
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 Oct 2012 16:14:09 +0000 (16:14 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 Oct 2012 16:17:49 +0000 (18:17 +0200)
src/journal/journalctl.c

index 3401748..9fbc9a3 100644 (file)
@@ -193,10 +193,17 @@ static int parse_argv(int argc, char *argv[]) {
                 case 'o':
                         arg_output = output_mode_from_string(optarg);
                         if (arg_output < 0) {
-                                log_error("Unknown output '%s'.", optarg);
+                                log_error("Unknown output format '%s'.", optarg);
                                 return -EINVAL;
                         }
 
+                        if (arg_output == OUTPUT_EXPORT ||
+                            arg_output == OUTPUT_JSON ||
+                            arg_output == OUTPUT_JSON_PRETTY ||
+                            arg_output == OUTPUT_JSON_SSE ||
+                            arg_output == OUTPUT_CAT)
+                                arg_quiet = true;
+
                         break;
 
                 case 'a':