]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
run0: add -n/--non-interactive as alias to --no-ask-password 42465/head
authorRonan Pigott <ronan@rjp.ie>
Thu, 4 Jun 2026 20:36:17 +0000 (13:36 -0700)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 20 Jun 2026 08:55:02 +0000 (09:55 +0100)
These are the flag names used by sudo with similar effect.

man/run0.xml
shell-completion/bash/run0
shell-completion/zsh/_run0
src/run/run.c

index 1887c145eaf1e775b43333e86c1d09f8938a8f42..fee0e08a5e11301e0f05130e433e02969760b38e 100644 (file)
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><option>-n</option></term>
+        <term><option>--non-interactive</option></term>
+
+        <listitem><para>Equivalent to <option>--no-ask-password</option>.</para>
+
+        <xi:include href="version-info.xml" xpointer="v262"/></listitem>
+      </varlistentry>
+
       <xi:include href="standard-options.xml" xpointer="no-ask-password" />
       <xi:include href="standard-options.xml" xpointer="help" />
       <xi:include href="standard-options.xml" xpointer="version" />
index 911633aaf8c16d5082e56484c827cfa7215d0e04..047f8182b2ca2e91f53389277c2c579d0724236b 100644 (file)
@@ -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
index de767678de1e02c75ec4bae4a59669627abd361e..163f20c4157ff7646dc41706d0edebf23ec0caac 100644 (file)
@@ -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'
index 2d12f23ef77705f161993f7ae8f4f59e25ccd9b4..96bd3af9fdfd20733058b7e61bf54b5769811515 100644 (file)
@@ -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)