chiark / gitweb /
journalctl: skip informational messages in export/json modes
[elogind.git] / src / journal / journalctl.c
index 58ca8071fc9315e59e9e33c237af816ff6d5400e..9fbc9a3489ef846d8c9d5f03f327f5b66e70c80d 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':
@@ -917,7 +924,7 @@ int main(int argc, char *argv[]) {
         }
 
         for (;;) {
-                while (arg_lines == 0 || n_shown < arg_lines) {
+                while (arg_lines == 0 || arg_follow || n_shown < arg_lines) {
                         int flags;
 
                         if (need_seek) {