machinectl: suppress redirection notice if --quiet is specified
authorLennart Poettering <lennart@poettering.net>
Fri, 31 May 2024 10:12:24 +0000 (12:12 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 9 Sep 2024 16:58:57 +0000 (18:58 +0200)
src/machine/machinectl.c

index 80c2522f9a3cc1b9ea2a366618b8d41a3a372396..934cfb27742149a853ebf9f6de7962e3823c8bba 100644 (file)
@@ -1958,7 +1958,8 @@ static int clean_images(int argc, char *argv[], void *userdata) {
 static int chainload_importctl(int argc, char *argv[]) {
         int r;
 
-        log_notice("The 'machinectl %1$s' command has been replaced by 'importctl -m %1$s'. Redirecting invocation.", argv[optind]);
+        if (!arg_quiet)
+                log_notice("The 'machinectl %1$s' command has been replaced by 'importctl -m %1$s'. Redirecting invocation.", argv[optind]);
 
         _cleanup_strv_free_ char **c =
                 strv_new("importctl", "--class=machine");