Compare commits
2 Commits
6f191822cf
...
b1796082ff
Author | SHA1 | Date |
---|---|---|
Yu Watanabe | b1796082ff | |
Yu Watanabe | 67fd3f173c |
|
@ -474,8 +474,10 @@
|
||||||
<term><option>-k</option></term>
|
<term><option>-k</option></term>
|
||||||
<term><option>--dmesg</option></term>
|
<term><option>--dmesg</option></term>
|
||||||
|
|
||||||
<listitem><para>Show only kernel messages. This implies <option>-b</option> and adds the match
|
<listitem><para>Show only kernel messages. This adds the match <literal>_TRANSPORT=kernel</literal>.
|
||||||
<literal>_TRANSPORT=kernel</literal>.</para>
|
This implies <option>--boot=0</option>, while the implication is overridden by specifying
|
||||||
|
<option>--boot=</option> with some boot specification, especially <option>--boot=all</option> will
|
||||||
|
disables the implication.</para>
|
||||||
|
|
||||||
<xi:include href="version-info.xml" xpointer="v205"/></listitem>
|
<xi:include href="version-info.xml" xpointer="v205"/></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -809,11 +811,12 @@
|
||||||
<term><option>--pager-end</option></term>
|
<term><option>--pager-end</option></term>
|
||||||
|
|
||||||
<listitem><para>Immediately jump to the end of the journal inside the implied pager tool. This
|
<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
|
implies <option>--lines=1000</option> and <option>--boot=0</option> to guarantee that the pager will
|
||||||
size. This may be overridden with an explicit <option>-n</option> with some other numeric value,
|
not buffer logs of unbounded size. This may be overridden with an explicit <option>--lines=</option>
|
||||||
while <option>-nall</option> will disable this cap. Note that this option is only supported for
|
with some other numeric value and/or <option>--boot=</option> with some specific boot specification,
|
||||||
the <citerefentry
|
while <option>--lines=all</option> and <option>--boot=all</option> will disable the implications.
|
||||||
project='man-pages'><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
Note that this option is only supported for the
|
||||||
|
<citerefentry project='man-pages'><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
||||||
pager.</para>
|
pager.</para>
|
||||||
|
|
||||||
<xi:include href="version-info.xml" xpointer="v198"/></listitem>
|
<xi:include href="version-info.xml" xpointer="v198"/></listitem>
|
||||||
|
|
|
@ -74,12 +74,8 @@ int journal_acquire_boot(sd_journal *j) {
|
||||||
|
|
||||||
assert(j);
|
assert(j);
|
||||||
|
|
||||||
if (!arg_boot) {
|
if (!arg_boot)
|
||||||
/* Clear relevant field for safety. */
|
|
||||||
arg_boot_id = SD_ID128_NULL;
|
|
||||||
arg_boot_offset = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
/* Take a shortcut and use the current boot_id, which we can do very quickly.
|
/* 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,
|
* We can do this only when the logs are coming from the current machine,
|
||||||
|
|
|
@ -45,7 +45,7 @@ bool arg_no_tail = false;
|
||||||
bool arg_truncate_newline = false;
|
bool arg_truncate_newline = false;
|
||||||
bool arg_quiet = false;
|
bool arg_quiet = false;
|
||||||
bool arg_merge = false;
|
bool arg_merge = false;
|
||||||
bool arg_boot = false;
|
int arg_boot = -1; /* tristate */
|
||||||
sd_id128_t arg_boot_id = {};
|
sd_id128_t arg_boot_id = {};
|
||||||
int arg_boot_offset = 0;
|
int arg_boot_offset = 0;
|
||||||
bool arg_dmesg = false;
|
bool arg_dmesg = false;
|
||||||
|
@ -452,12 +452,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
arg_pager_flags |= PAGER_JUMP_TO_END;
|
arg_pager_flags |= PAGER_JUMP_TO_END;
|
||||||
|
|
||||||
if (arg_lines == ARG_LINES_DEFAULT)
|
|
||||||
arg_lines = 1000;
|
|
||||||
|
|
||||||
arg_boot = true;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
|
@ -563,7 +557,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'k':
|
case 'k':
|
||||||
arg_boot = arg_dmesg = true;
|
arg_dmesg = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ARG_SYSTEM:
|
case ARG_SYSTEM:
|
||||||
|
@ -987,11 +981,19 @@ static int parse_argv(int argc, char *argv[]) {
|
||||||
if (arg_no_tail)
|
if (arg_no_tail)
|
||||||
arg_lines = ARG_LINES_ALL;
|
arg_lines = ARG_LINES_ALL;
|
||||||
|
|
||||||
if (arg_follow && !arg_since_set && arg_lines == ARG_LINES_DEFAULT)
|
if (arg_lines == ARG_LINES_DEFAULT) {
|
||||||
arg_lines = 10;
|
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) {
|
if (arg_boot < 0)
|
||||||
arg_boot = true;
|
/* Show the current boot if -f/--follow, -k/--dmesg, or -e/--pager-end is specified unless
|
||||||
|
* -m/--merge is unspecified. */
|
||||||
|
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_id = SD_ID128_NULL;
|
||||||
arg_boot_offset = 0;
|
arg_boot_offset = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ extern bool arg_no_tail;
|
||||||
extern bool arg_truncate_newline;
|
extern bool arg_truncate_newline;
|
||||||
extern bool arg_quiet;
|
extern bool arg_quiet;
|
||||||
extern bool arg_merge;
|
extern bool arg_merge;
|
||||||
extern bool arg_boot;
|
extern int arg_boot;
|
||||||
extern sd_id128_t arg_boot_id;
|
extern sd_id128_t arg_boot_id;
|
||||||
extern int arg_boot_offset;
|
extern int arg_boot_offset;
|
||||||
extern bool arg_dmesg;
|
extern bool arg_dmesg;
|
||||||
|
|
Loading…
Reference in New Issue