summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2019-10-23 09:13:15 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-10-23 22:06:32 +0900
commit7976b9f0988f435316d7817b63d5e122cbc32cbc (patch)
treeede9d09fa348bcf32e4a6f125329c897f2eeeea6
parentc0c8886141c7d7acbc6691ee8e905e754914e93d (diff)
downloadsystemd-7976b9f0988f435316d7817b63d5e122cbc32cbc.tar.gz
run: add -u as a synonym for --unit
Other tools that do have --unit= option (journalctl and systemd-cgls) already do this, so let's be consistent.
-rw-r--r--man/systemd-run.xml1
-rw-r--r--src/run/run.c9
2 files changed, 5 insertions, 5 deletions
diff --git a/man/systemd-run.xml b/man/systemd-run.xml
index 8f7a6229cc..610c3acd37 100644
--- a/man/systemd-run.xml
+++ b/man/systemd-run.xml
@@ -117,6 +117,7 @@
<varlistentry>
<term><option>--unit=</option></term>
+ <term><option>-u</option></term>
<listitem><para>Use this unit name instead of an automatically
generated one.</para></listitem>
diff --git a/src/run/run.c b/src/run/run.c
index 68a3750390..e7d8b30a7a 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -92,7 +92,7 @@ static int help(void) {
" -H --host=[USER@]HOST Operate on remote host\n"
" -M --machine=CONTAINER Operate on local container\n"
" --scope Run this as scope rather than service\n"
- " --unit=UNIT Run under the specified unit name\n"
+ " -u --unit=UNIT Run under the specified unit name\n"
" -p --property=NAME=VALUE Set service or scope unit property\n"
" --description=TEXT Description for unit\n"
" --slice=SLICE Run in the specified slice\n"
@@ -158,7 +158,6 @@ static int parse_argv(int argc, char *argv[]) {
ARG_USER,
ARG_SYSTEM,
ARG_SCOPE,
- ARG_UNIT,
ARG_DESCRIPTION,
ARG_SLICE,
ARG_SEND_SIGHUP,
@@ -190,7 +189,7 @@ static int parse_argv(int argc, char *argv[]) {
{ "user", no_argument, NULL, ARG_USER },
{ "system", no_argument, NULL, ARG_SYSTEM },
{ "scope", no_argument, NULL, ARG_SCOPE },
- { "unit", required_argument, NULL, ARG_UNIT },
+ { "unit", required_argument, NULL, 'u' },
{ "description", required_argument, NULL, ARG_DESCRIPTION },
{ "slice", required_argument, NULL, ARG_SLICE },
{ "remain-after-exit", no_argument, NULL, 'r' },
@@ -234,7 +233,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "+hrH:M:E:p:tPqGdS", options, NULL)) >= 0)
+ while ((c = getopt_long(argc, argv, "+hrH:M:E:p:tPqGdSu:", options, NULL)) >= 0)
switch (c) {
@@ -260,7 +259,7 @@ static int parse_argv(int argc, char *argv[]) {
arg_scope = true;
break;
- case ARG_UNIT:
+ case 'u':
arg_unit = optarg;
break;