chiark / gitweb /
systemctl: fix typos in help text
[elogind.git] / src / systemctl / systemctl.c
index b82c79435d29acf9cd2f8c5ac937c5de73ffe01f..6d01756ffb3b3c9ceaa0d0d62f9338e6c27ea300 100644 (file)
@@ -426,6 +426,7 @@ static void output_units_list(const struct unit_info *unit_infos, unsigned c) {
                                "SUB    = The low-level unit activation state, values depend on unit type.\n");
                         if (job_count)
                                 printf("JOB    = Pending job for the unit.\n");
+                        puts("");
                         on = ansi_highlight(true);
                         off = ansi_highlight(false);
                 } else {
@@ -434,11 +435,11 @@ static void output_units_list(const struct unit_info *unit_infos, unsigned c) {
                 }
 
                 if (arg_all)
-                        printf("\n%s%u loaded units listed.%s\n"
+                        printf("%s%u loaded units listed.%s\n"
                                "To show all installed unit files use 'systemctl list-unit-files'.\n",
                                on, n_shown, off);
                 else
-                        printf("\n%s%u loaded units listed.%s Pass --all to see loaded but inactive units, too.\n"
+                        printf("%s%u loaded units listed.%s Pass --all to see loaded but inactive units, too.\n"
                                "To show all installed unit files use 'systemctl list-unit-files'.\n",
                                on, n_shown, off);
         }
@@ -1341,9 +1342,9 @@ static int wait_for_jobs(DBusConnection *bus, Set *s) {
                         else if (streq(d.result, "canceled"))
                                 log_error("Job for %s canceled.", strna(d.name));
                         else if (streq(d.result, "dependency"))
-                                log_error("A dependency job for %s failed. See 'journalctl -n' for details.", strna(d.name));
+                                log_error("A dependency job for %s failed. See 'journalctl -xn' for details.", strna(d.name));
                         else if (!streq(d.result, "done") && !streq(d.result, "skipped"))
-                                log_error("Job for %s failed. See 'systemctl status %s' and 'journalctl -n' for details.", strna(d.name), strna(d.name));
+                                log_error("Job for %s failed. See 'systemctl status %s' and 'journalctl -xn' for details.", strna(d.name), strna(d.name));
                 }
 
                 if (streq_ptr(d.result, "timeout"))
@@ -2055,7 +2056,7 @@ static void print_status_info(UnitStatusInfo *i) {
         ExecStatusInfo *p;
         const char *on, *off, *ss;
         usec_t timestamp;
-        char since1[FORMAT_TIMESTAMP_PRETTY_MAX], *s1;
+        char since1[FORMAT_TIMESTAMP_RELATIVE_MAX], *s1;
         char since2[FORMAT_TIMESTAMP_MAX], *s2;
         const char *path;
 
@@ -2124,7 +2125,7 @@ static void print_status_info(UnitStatusInfo *i) {
                     streq_ptr(i->active_state, "activating")    ? i->inactive_exit_timestamp :
                                                                   i->active_exit_timestamp;
 
-        s1 = format_timestamp_pretty(since1, sizeof(since1), timestamp);
+        s1 = format_timestamp_relative(since1, sizeof(since1), timestamp);
         s2 = format_timestamp(since2, sizeof(since2), timestamp);
 
         if (s1)
@@ -2135,7 +2136,7 @@ static void print_status_info(UnitStatusInfo *i) {
                 printf("\n");
 
         if (!i->condition_result && i->condition_timestamp > 0) {
-                s1 = format_timestamp_pretty(since1, sizeof(since1), i->condition_timestamp);
+                s1 = format_timestamp_relative(since1, sizeof(since1), i->condition_timestamp);
                 s2 = format_timestamp(since2, sizeof(since2), i->condition_timestamp);
 
                 if (s1)
@@ -3932,9 +3933,9 @@ static int systemctl_help(void) {
                "  reload [NAME...]                Reload one or more units\n"
                "  restart [NAME...]               Start or restart one or more units\n"
                "  try-restart [NAME...]           Restart one or more units if active\n"
-               "  reload-or-restart [NAME...]     Reload one or more units is possible,\n"
+               "  reload-or-restart [NAME...]     Reload one or more units if possible,\n"
                "                                  otherwise start or restart\n"
-               "  reload-or-try-restart [NAME...] Reload one or more units is possible,\n"
+               "  reload-or-try-restart [NAME...] Reload one or more units if possible,\n"
                "                                  otherwise restart if active\n"
                "  isolate [NAME]                  Start one unit and stop all others\n"
                "  kill [NAME...]                  Send signal to processes of a unit\n"
@@ -4057,6 +4058,22 @@ static int runlevel_help(void) {
         return 0;
 }
 
+static int help_types(void) {
+        int i;
+
+        puts("Available unit types:");
+        for(i = UNIT_SERVICE; i < _UNIT_TYPE_MAX; i++)
+                if (unit_type_table[i])
+                        puts(unit_type_table[i]);
+
+        puts("\nAvailable unit load states: ");
+        for(i = UNIT_STUB; i < _UNIT_LOAD_STATE_MAX; i++)
+                if (unit_type_table[i])
+                        puts(unit_load_state_table[i]);
+
+        return 0;
+}
+
 static int systemctl_parse_argv(int argc, char *argv[]) {
 
         enum {
@@ -4136,6 +4153,11 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case 't':
+                        if (streq(optarg, "help")) {
+                                help_types();
+                                return 0;
+                        }
+
                         if (unit_type_from_string(optarg) >= 0) {
                                 arg_type = optarg;
                                 break;
@@ -4146,6 +4168,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                         }
                         log_error("Unkown unit type or load state '%s'.",
                                   optarg);
+                        log_info("Use -t help to see a list of allowed values.");
                         return -EINVAL;
                 case 'p': {
                         char **l;