chiark / gitweb /
test: extend calendarspec test a bit
[elogind.git] / src / hostname / hostnamectl.c
index 1d448bd944f2d3b61a16f8dd1314b7d06d0bd4b1..265c7ecbfe6ccc1c2bf14b1bcce03737cd2979ca 100644 (file)
@@ -23,6 +23,7 @@
 #include <stdbool.h>
 #include <unistd.h>
 #include <getopt.h>
+#include <locale.h>
 #include <string.h>
 #include <sys/timex.h>
 #include <sys/utsname.h>
@@ -402,6 +403,10 @@ static int parse_argv(int argc, char *argv[]) {
                         arg_set_static = true;
                         break;
 
+                case ARG_NO_ASK_PASSWORD:
+                        arg_ask_password = false;
+                        break;
+
                 case '?':
                         return -EINVAL;
 
@@ -430,7 +435,7 @@ static int hostnamectl_main(DBusConnection *bus, int argc, char *argv[], DBusErr
                 int (* const dispatch)(DBusConnection *bus, char **args, unsigned n);
         } verbs[] = {
                 { "status",              LESS,   1, show_status         },
-                { "set-hostname",        LESS,   2, set_hostname        },
+                { "set-hostname",        EQUAL,  2, set_hostname        },
                 { "set-icon-name",       EQUAL,  2, set_icon_name       },
         };
 
@@ -507,6 +512,7 @@ int main(int argc, char *argv[]) {
 
         dbus_error_init(&error);
 
+        setlocale(LC_ALL, "");
         log_parse_environment();
         log_open();