X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemctl%2Fsystemctl.c;h=ba4f171fdafe44147add6d0ae7fb0512d6acd4fc;hp=b82c79435d29acf9cd2f8c5ac937c5de73ffe01f;hb=bbb8486e1709ee297a1eb803f88041e1da1fa436;hpb=a9cdc94f7ff40f22a3cf9472f612a80730a1b010 diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index b82c79435..ba4f171fd 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -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")) @@ -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) @@ -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;