chiark / gitweb /
Add short-iso-precise for journalctl output (#5884)
[elogind.git] / src / login / loginctl.c
index 13d8f807421c024077404eea2efe67294d2108b2..9ff1b781df4e9d50e2cee0d7c0413f3e91fb4a6a 100644 (file)
@@ -950,7 +950,7 @@ static int show_session(int argc, char *argv[], void *userdata) {
                 _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
                 _cleanup_free_ char *path = NULL;
 
-                r = get_session_path(bus, argv[1], &error, &path);
+                r = get_session_path(bus, argv[i], &error, &path);
                 if (r < 0) {
                         log_error("Failed to get session path: %s", bus_error_message(&error, r));
                         return r;
@@ -1411,15 +1411,19 @@ static int help(int argc, char *argv[], void *userdata) {
                "  -s --signal=SIGNAL       Which signal to send\n"
 #if 0 /// UNNEEDED by elogind
                "  -n --lines=INTEGER       Number of journal entries to show\n"
-               "  -o --output=STRING       Change journal output mode (short, short-monotonic,\n"
-               "                           verbose, export, json, json-pretty, json-sse, cat)\n\n"
+               "  -o --output=STRING       Change journal output mode (short, short-precise,\n"
+               "                             short-iso, short-iso-precise, short-full,\n"
+               "                             short-monotonic, short-unix, verbose, export,\n"
+               "                             json, json-pretty, json-sse, cat)\n"
 #else
                 /// elogind can cancel shutdowns and allows to ignore inhibitors
                "  -c                       Cancel a pending shutdown or reboot\n"
                "  -i --ignore-inhibitors   When shutting down or sleeping, ignore inhibitors\n\n"
 #endif // 0
                "Session Commands:\n"
-               "  list-sessions            List sessions\n"
+#if 1 /// elogind has "list" as a shorthand for "list-sessions"
+               "  list[-sessions]          List sessions (default command)\n"
+#endif // 1
                "  session-status [ID...]   Show session status\n"
                "  show-session [ID...]     Show properties of sessions or the manager\n"
                "  activate [ID]            Activate a session\n"
@@ -1620,7 +1624,12 @@ static int loginctl_main(int argc, char *argv[], sd_bus *bus) {
 
         static const Verb verbs[] = {
                 { "help",              VERB_ANY, VERB_ANY, 0,            help              },
+#if 0 /// elogind has "list" as a shorthand for "list-sessions"
                 { "list-sessions",     VERB_ANY, 1,        VERB_DEFAULT, list_sessions     },
+#else
+                { "list",              VERB_ANY, 1,        VERB_DEFAULT, list_sessions     },
+                { "list-sessions",     VERB_ANY, 1,        0,            list_sessions     },
+#endif // 0
                 { "session-status",    VERB_ANY, VERB_ANY, 0,            show_session      },
                 { "show-session",      VERB_ANY, VERB_ANY, 0,            show_session      },
                 { "activate",          VERB_ANY, 2,        0,            activate          },