]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredumpctl: info shows the last entry by default
authorLion Yang <lion@aosc.io>
Sat, 7 Jul 2018 22:00:39 +0000 (06:00 +0800)
committerLennart Poettering <lennart@poettering.net>
Mon, 23 Jul 2018 15:45:53 +0000 (17:45 +0200)
Closes #9524.

man/coredumpctl.xml
src/coredump/coredumpctl.c

index caa1bb1c0f7274101e4c1aa93d2081017931e879..94d5626fb53ed355c31e4e9bb737d6866a1ff4b0 100644 (file)
       <varlistentry>
         <term><command>info</command></term>
 
-        <listitem><para>Show detailed information about core dumps
+        <listitem><para>Show detailed information about the last core dump
+        or core dumps matching specified characteristics
         captured in the journal.</para></listitem>
       </varlistentry>
 
index 99d07c14fb9f5a4a2696a30d18ea93fbf3168cc2..e7ba8d366442a85e868c92e1801fa23d915b47e5 100644 (file)
@@ -654,7 +654,8 @@ static int dump_list(int argc, char **argv, void *userdata) {
          * pick a fairly low data threshold here */
         sd_journal_set_data_threshold(j, 4096);
 
-        if (arg_one) {
+        /* "info" without pattern implies "-1" */
+        if (arg_one || (verb_is_info && argc == 1)) {
                 r = focus(j);
                 if (r < 0)
                         return r;