]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl: also refuse --cursor-file= with --since=
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 18 Dec 2023 16:06:43 +0000 (17:06 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 18 Dec 2023 16:06:43 +0000 (17:06 +0100)
We already refuse the other two cursor-related options (--cursor= and
--after-cursor=) with --since=, so let's do the same with
--cursor-file=.

Closes: #20523
src/journal/journalctl.c

index de1534befd2c894db37d0fd1a39852e997d242eb..fe68ec4310b3dc40358e30d3228bca5d4e69c588 100644 (file)
@@ -1088,9 +1088,9 @@ static int parse_argv(int argc, char *argv[]) {
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                        "--since= must be before --until=.");
 
-        if (!!arg_cursor + !!arg_after_cursor + !!arg_since_set > 1)
+        if (!!arg_cursor + !!arg_after_cursor + !!arg_cursor_file + !!arg_since_set > 1)
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
-                                       "Please specify only one of --since=, --cursor=, and --after-cursor=.");
+                                       "Please specify only one of --since=, --cursor=, --cursor-file=, and --after-cursor=.");
 
         if (arg_follow && arg_reverse)
                 return log_error_errno(SYNTHETIC_ERRNO(EINVAL),