X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemctl%2Fsystemctl.c;h=f6eed1cc7f60593240cf824ecf593451e9e1e7e7;hp=39f4e6c5093f8c8479e26212f6a6c136265a2ec3;hb=45c0c61df3c63cb1f20505c8d292385d5e300578;hpb=48c2826b4ea686cd69e489f9c6fe2d9ddebb6a69 diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 39f4e6c50..f6eed1cc7 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -4058,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 { @@ -4137,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; @@ -4147,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;