ubusd: make ACL path configurable on the command line
[project/ubus.git] / ubusd.c
diff --git a/ubusd.c b/ubusd.c
index 6629720..f1f8ac7 100644 (file)
--- a/ubusd.c
+++ b/ubusd.c
@@ -356,6 +356,7 @@ static int usage(const char *progname)
 {
        fprintf(stderr, "Usage: %s [<options>]\n"
                "Options: \n"
+               "  -A <path>:           Set the path to ACL files\n"
                "  -s <socket>:         Set the unix domain socket to listen on\n"
                "\n", progname);
        return 1;
@@ -378,11 +379,14 @@ int main(int argc, char **argv)
        openlog("ubusd", LOG_PID, LOG_DAEMON);
        uloop_init();
 
-       while ((ch = getopt(argc, argv, "s:")) != -1) {
+       while ((ch = getopt(argc, argv, "A:s:")) != -1) {
                switch (ch) {
                case 's':
                        ubus_socket = optarg;
                        break;
+               case 'A':
+                       ubusd_acl_dir = optarg;
+                       break;
                default:
                        return usage(argv[0]);
                }