Fixes #35248.
<term><option>-k</option></term>
<term><option>--dmesg</option></term>
- <listitem><para>Show only kernel messages. This implies <option>-b</option> and adds the match
- <literal>_TRANSPORT=kernel</literal>.</para>
+ <listitem><para>Show only kernel messages. This adds the match <literal>_TRANSPORT=kernel</literal>.
+ This implies <option>--boot=0</option> unless explicitly specified otherwise.</para>
<xi:include href="version-info.xml" xpointer="v205"/></listitem>
</varlistentry>
<term><option>--pager-end</option></term>
<listitem><para>Immediately jump to the end of the journal inside the implied pager tool. This
- implies <option>-n1000</option> to guarantee that the pager will not buffer logs of unbounded
- size. This may be overridden with an explicit <option>-n</option> with some other numeric value,
- while <option>-nall</option> will disable this cap. Note that this option is only supported for
- the <citerefentry
- project='man-pages'><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ implies <option>--lines=1000</option> and <option>--boot=0</option> unless explicitly specified
+ otherwise, to guarantee that the pager will not buffer logs of unbounded size. Note that this option
+ is only supported for the
+ <citerefentry project='man-pages'><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry>
pager.</para>
<xi:include href="version-info.xml" xpointer="v198"/></listitem>
assert(j);
- if (!arg_boot) {
- /* Clear relevant field for safety. */
- arg_boot_id = SD_ID128_NULL;
- arg_boot_offset = 0;
+ if (!arg_boot)
return 0;
- }
/* Take a shortcut and use the current boot_id, which we can do very quickly.
* We can do this only when the logs are coming from the current machine,
bool arg_truncate_newline = false;
bool arg_quiet = false;
bool arg_merge = false;
-bool arg_boot = false;
+int arg_boot = -1; /* tristate */
sd_id128_t arg_boot_id = {};
int arg_boot_offset = 0;
bool arg_dmesg = false;
case 'e':
arg_pager_flags |= PAGER_JUMP_TO_END;
-
- if (arg_lines == ARG_LINES_DEFAULT)
- arg_lines = 1000;
-
- arg_boot = true;
-
break;
case 'f':
break;
case 'k':
- arg_boot = arg_dmesg = true;
+ arg_dmesg = true;
break;
case ARG_SYSTEM:
if (arg_no_tail)
arg_lines = ARG_LINES_ALL;
- if (arg_follow && !arg_since_set && arg_lines == ARG_LINES_DEFAULT)
- arg_lines = 10;
+ if (arg_lines == ARG_LINES_DEFAULT) {
+ if (arg_follow && !arg_since_set)
+ arg_lines = 10;
+ else if (FLAGS_SET(arg_pager_flags, PAGER_JUMP_TO_END))
+ arg_lines = 1000;
+ }
- if (arg_follow && !arg_merge && !arg_boot) {
- arg_boot = true;
+ if (arg_boot < 0)
+ /* Show the current boot if -f/--follow, -k/--dmesg, or -e/--pager-end is specified unless
+ * -m/--merge is specified. */
+ arg_boot = !arg_merge && (arg_follow || arg_dmesg || FLAGS_SET(arg_pager_flags, PAGER_JUMP_TO_END));
+ if (!arg_boot) {
+ /* Clear the boot ID and offset if -b/--boot is unspecified for safety. */
arg_boot_id = SD_ID128_NULL;
arg_boot_offset = 0;
}
extern bool arg_truncate_newline;
extern bool arg_quiet;
extern bool arg_merge;
-extern bool arg_boot;
+extern int arg_boot;
extern sd_id128_t arg_boot_id;
extern int arg_boot_offset;
extern bool arg_dmesg;