From: Ronan Pigott Date: Thu, 4 Jun 2026 20:36:17 +0000 (-0700) Subject: run0: add -n/--non-interactive as alias to --no-ask-password X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e15fbf3349d5e7fd3a71a5c6ac43bb045eecd14b;p=thirdparty%2Fsystemd.git run0: add -n/--non-interactive as alias to --no-ask-password These are the flag names used by sudo with similar effect. --- diff --git a/man/run0.xml b/man/run0.xml index 1887c145eaf..fee0e08a5e1 100644 --- a/man/run0.xml +++ b/man/run0.xml @@ -357,6 +357,15 @@ + + + + + Equivalent to . + + + + diff --git a/shell-completion/bash/run0 b/shell-completion/bash/run0 index 911633aaf8c..047f8182b2c 100644 --- a/shell-completion/bash/run0 +++ b/shell-completion/bash/run0 @@ -38,7 +38,7 @@ _run0() { --setenv --background ) local OPTS="${opts_with_values[*]} -h --help -V --version --no-ask-password --slice-inherit --empower" - OPTS="$OPTS -k --reset-timestamp -K --remove-timestamp -v --validate" + OPTS="$OPTS -k --reset-timestamp -K --remove-timestamp -v --validate -n --non-interactive" local i for (( i=1; i <= COMP_CWORD; i++ )); do diff --git a/shell-completion/zsh/_run0 b/shell-completion/zsh/_run0 index de767678de1..163f20c4157 100644 --- a/shell-completion/zsh/_run0 +++ b/shell-completion/zsh/_run0 @@ -37,7 +37,7 @@ _run0_slices() { } local -a args=( - '--no-ask-password[Do not query the user for authentication]' + '(-n --non-interactive --no-ask-password)'{-n,--non-interactive,--no-ask-password}'[Do not query the user for authentication]' '--unit=[Use this unit name instead of an automatically generated one]' {'*--property=','*-p+'}'[Sets a property on the service unit created]:property:_run0_unit_properties' '--description=[Provide a description for the service unit]:TEXT' diff --git a/src/run/run.c b/src/run/run.c index 2d12f23ef77..96bd3af9fdf 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -801,6 +801,10 @@ static int parse_argv_sudo_mode(int argc, char *argv[]) { arg_ask_password = false; break; + OPTION('n', "non-interactive", NULL, "Do not prompt for password"): + arg_ask_password = false; + break; + OPTION_LONG("machine", "CONTAINER", "Operate on local container"): r = parse_machine_argument(opts.arg, &arg_host, &arg_transport); if (r < 0)