1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 10:25:37 +03:00

run: add -E as alias for --setenv

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-04-20 08:38:01 -04:00
parent a5f1cb3bad
commit b5911366d0
2 changed files with 7 additions and 8 deletions

View File

@ -226,11 +226,11 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>--setenv=</option></term> <term><option>-E <replaceable>NAME</replaceable>=<replaceable>VALUE</replaceable></option></term>
<term><option>--setenv=<replaceable>NAME</replaceable>=<replaceable>VALUE</replaceable></option></term>
<listitem><para>Runs the service process with the specified <listitem><para>Runs the service process with the specified environment variable set.
environment variables set. Also see Also see <varname>Environment=</varname> in
<varname>Environment=</varname> in
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -103,7 +103,7 @@ static void help(void) {
" --uid=USER Run as system user\n" " --uid=USER Run as system user\n"
" --gid=GROUP Run as system group\n" " --gid=GROUP Run as system group\n"
" --nice=NICE Nice level\n" " --nice=NICE Nice level\n"
" --setenv=NAME=VALUE Set environment\n" " -E --setenv=NAME=VALUE Set environment\n"
" -t --pty Run service on pseudo tty\n" " -t --pty Run service on pseudo tty\n"
" -q --quiet Suppress information messages during runtime\n\n" " -q --quiet Suppress information messages during runtime\n\n"
"Timer options:\n\n" "Timer options:\n\n"
@ -136,7 +136,6 @@ static int parse_argv(int argc, char *argv[]) {
ARG_EXEC_USER, ARG_EXEC_USER,
ARG_EXEC_GROUP, ARG_EXEC_GROUP,
ARG_NICE, ARG_NICE,
ARG_SETENV,
ARG_ON_ACTIVE, ARG_ON_ACTIVE,
ARG_ON_BOOT, ARG_ON_BOOT,
ARG_ON_STARTUP, ARG_ON_STARTUP,
@ -165,7 +164,7 @@ static int parse_argv(int argc, char *argv[]) {
{ "uid", required_argument, NULL, ARG_EXEC_USER }, { "uid", required_argument, NULL, ARG_EXEC_USER },
{ "gid", required_argument, NULL, ARG_EXEC_GROUP }, { "gid", required_argument, NULL, ARG_EXEC_GROUP },
{ "nice", required_argument, NULL, ARG_NICE }, { "nice", required_argument, NULL, ARG_NICE },
{ "setenv", required_argument, NULL, ARG_SETENV }, { "setenv", required_argument, NULL, 'E' },
{ "property", required_argument, NULL, 'p' }, { "property", required_argument, NULL, 'p' },
{ "tty", no_argument, NULL, 't' }, /* deprecated */ { "tty", no_argument, NULL, 't' }, /* deprecated */
{ "pty", no_argument, NULL, 't' }, { "pty", no_argument, NULL, 't' },
@ -266,7 +265,7 @@ static int parse_argv(int argc, char *argv[]) {
arg_nice_set = true; arg_nice_set = true;
break; break;
case ARG_SETENV: case 'E':
if (strv_extend(&arg_environment, optarg) < 0) if (strv_extend(&arg_environment, optarg) < 0)
return log_oom(); return log_oom();