diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-08-24 10:41:30 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-08-26 11:15:44 +0900 |
commit | 4ccde410a3fc141c9ddf285f24a22dfea99e0287 (patch) | |
tree | 7cf167007dca0a7b1f77e9be3909f11e9b9a9ded /src/systemctl | |
parent | 2f968def113e601baf8a7dc65263f2f12bc4dc16 (diff) | |
download | systemd-4ccde410a3fc141c9ddf285f24a22dfea99e0287.tar.gz |
tree-wide: change --kill-who to --kill-whom
getopt allows non-ambiguous abbreviations, so backwards-compat is maintained, and
people can use --kill-who (or even shorter abbreviations). English is flexible,
so in common speach people would use both forms, even if "whom" is technically
more correct. The advantage of using the longer form in the code is that we
effectively allow both forms, so we stop punishing people who DTGCT¹, but still
allow people to use the spoken form if they prefer.
1. Do the gramatically correct thing
Diffstat (limited to 'src/systemctl')
-rw-r--r-- | src/systemctl/systemctl-kill.c | 10 | ||||
-rw-r--r-- | src/systemctl/systemctl.c | 14 | ||||
-rw-r--r-- | src/systemctl/systemctl.h | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/systemctl/systemctl-kill.c b/src/systemctl/systemctl-kill.c index 1a8b4a3eda..b3ae8bbcc2 100644 --- a/src/systemctl/systemctl-kill.c +++ b/src/systemctl/systemctl-kill.c @@ -8,7 +8,7 @@ int verb_kill(int argc, char *argv[], void *userdata) { _cleanup_strv_free_ char **names = NULL; - char *kill_who = NULL; + char *kill_whom = NULL; sd_bus *bus; int r, q; @@ -18,12 +18,12 @@ int verb_kill(int argc, char *argv[], void *userdata) { polkit_agent_open_maybe(); - if (!arg_kill_who) - arg_kill_who = "all"; + if (!arg_kill_whom) + arg_kill_whom = "all"; /* --fail was specified */ if (streq(arg_job_mode(), "fail")) - kill_who = strjoina(arg_kill_who, "-fail"); + kill_whom = strjoina(arg_kill_whom, "-fail"); r = expand_unit_names(bus, strv_skip(argv, 1), NULL, &names, NULL); if (r < 0) @@ -38,7 +38,7 @@ int verb_kill(int argc, char *argv[], void *userdata) { "KillUnit", &error, NULL, - "ssi", *name, kill_who ? kill_who : arg_kill_who, arg_signal); + "ssi", *name, kill_whom ?: arg_kill_whom, arg_signal); if (q < 0) { log_error_errno(q, "Failed to kill unit %s: %s", *name, bus_error_message(&error, q)); if (r == 0) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index fb40c478c2..ae046e73a3 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -89,7 +89,7 @@ bool arg_ask_password = false; bool arg_runtime = false; UnitFilePresetMode arg_preset_mode = UNIT_FILE_PRESET_FULL; char **arg_wall = NULL; -const char *arg_kill_who = NULL; +const char *arg_kill_whom = NULL; int arg_signal = SIGTERM; char *arg_root = NULL; usec_t arg_when = 0; @@ -117,7 +117,7 @@ STATIC_DESTRUCTOR_REGISTER(arg_states, strv_freep); STATIC_DESTRUCTOR_REGISTER(arg_properties, strv_freep); STATIC_DESTRUCTOR_REGISTER(_arg_job_mode, unsetp); STATIC_DESTRUCTOR_REGISTER(arg_wall, strv_freep); -STATIC_DESTRUCTOR_REGISTER(arg_kill_who, unsetp); +STATIC_DESTRUCTOR_REGISTER(arg_kill_whom, unsetp); STATIC_DESTRUCTOR_REGISTER(arg_root, freep); STATIC_DESTRUCTOR_REGISTER(arg_reboot_argument, unsetp); STATIC_DESTRUCTOR_REGISTER(arg_host, unsetp); @@ -262,7 +262,7 @@ static int systemctl_help(void) { " Whether to check inhibitors before shutting down,\n" " sleeping, or hibernating\n" " -i Shortcut for --check-inhibitors=no\n" - " --kill-who=WHO Whom to send signal to\n" + " --kill-whom=WHOM Whom to send signal to\n" " -s --signal=SIGNAL Which signal to send\n" " --what=RESOURCES Which types of resources to remove\n" " --now Start or stop unit after enabling or disabling it\n" @@ -403,7 +403,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) { ARG_NO_WALL, ARG_ROOT, ARG_NO_RELOAD, - ARG_KILL_WHO, + ARG_KILL_WHOM, ARG_NO_ASK_PASSWORD, ARG_FAILED, ARG_RUNTIME, @@ -459,7 +459,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) { { "root", required_argument, NULL, ARG_ROOT }, { "force", no_argument, NULL, 'f' }, { "no-reload", no_argument, NULL, ARG_NO_RELOAD }, - { "kill-who", required_argument, NULL, ARG_KILL_WHO }, + { "kill-whom", required_argument, NULL, ARG_KILL_WHOM }, { "signal", required_argument, NULL, 's' }, { "no-ask-password", no_argument, NULL, ARG_NO_ASK_PASSWORD }, { "host", required_argument, NULL, 'H' }, @@ -693,8 +693,8 @@ static int systemctl_parse_argv(int argc, char *argv[]) { arg_no_reload = true; break; - case ARG_KILL_WHO: - arg_kill_who = optarg; + case ARG_KILL_WHOM: + arg_kill_whom = optarg; break; case 's': diff --git a/src/systemctl/systemctl.h b/src/systemctl/systemctl.h index 7507398c4a..2454c4c714 100644 --- a/src/systemctl/systemctl.h +++ b/src/systemctl/systemctl.h @@ -74,7 +74,7 @@ extern bool arg_ask_password; extern bool arg_runtime; extern UnitFilePresetMode arg_preset_mode; extern char **arg_wall; -extern const char *arg_kill_who; +extern const char *arg_kill_whom; extern int arg_signal; extern char *arg_root; extern usec_t arg_when; |