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
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-08-26 11:15:44 +09:00
committed by Yu Watanabe
parent 2f968def11
commit 4ccde410a3
18 changed files with 53 additions and 52 deletions
+5 -5
View File
@@ -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)
+7 -7
View File
@@ -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':
+1 -1
View File
@@ -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;