]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
userdbctl: require value for --output=
authorDavid Tardon <dtardon@redhat.com>
Thu, 2 Oct 2025 13:57:10 +0000 (15:57 +0200)
committerDavid Tardon <dtardon@redhat.com>
Thu, 2 Oct 2025 14:13:40 +0000 (16:13 +0200)
Currently, when --output= is used with empty string, it resets the mode.
E.g.,

 # userdbctl user --output=json --output= ...

will use the default output mode, not JSON. But that functionality is
not documented and it seems to be of little practical use. Let's just
drop it.

src/userdb/userdbctl.c

index 9959869e7afe6103e26e2e3d8fe28052b19634cd..da3901a07eb91667bb7195c22df958d78651bf3d 100644 (file)
@@ -1652,9 +1652,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_OUTPUT:
-                        if (isempty(optarg))
-                                arg_output = _OUTPUT_INVALID;
-                        else if (streq(optarg, "classic"))
+                        if (streq(optarg, "classic"))
                                 arg_output = OUTPUT_CLASSIC;
                         else if (streq(optarg, "friendly"))
                                 arg_output = OUTPUT_FRIENDLY;