diff --git a/src/matahari-net.cpp b/src/matahari-net.cpp index 77b0cf0..8be737b 100644 --- a/src/matahari-net.cpp +++ b/src/matahari-net.cpp @@ -69,6 +69,7 @@ print_usage() printf("\t-u | --username username to use for authentication purproses.\n"); printf("\t-s | --service service name to use for authentication purproses.\n"); printf("\t-p | --port specify broker port.\n"); + printf("\t-l | --local-only Run only on local host using dbus.\n"); } #endif @@ -80,6 +81,8 @@ main(int argc, char **argv) int idx = 0; bool verbose = false; bool daemonize = false; + bool local_only = false; + bool local = true; #endif bool gssapi = false; char *servername = strdup(MATAHARI_BROKER); @@ -99,11 +102,12 @@ main(int argc, char **argv) {"username", required_argument, NULL, 'u'}, {"service", required_argument, NULL, 's'}, {"port", required_argument, NULL, 'p'}, + {"local-only", no_argument, NULL, 'l'}, {0, 0, 0, 0} }; // Get args - while ((arg = getopt_long(argc, argv, "hdb:gu:s:p:", opt, &idx)) != -1) { + while ((arg = getopt_long(argc, argv, "hdb:gu:s:p:l", opt, &idx)) != -1) { switch (arg) { case 'h': case '?': @@ -151,6 +155,9 @@ main(int argc, char **argv) exit(1); } break; + case 'l': + local_only = true; + break; default: fprintf(stderr, "unsupported option '-%c'. See --help.\n", arg); print_usage(); @@ -165,6 +172,22 @@ main(int argc, char **argv) exit(1); } } + + // How we handle this? Will we always run local config? + // I will assume we will chose from local or net + if (local_only) { + // TODO + // run the dbus interface + fprintf(stderr, "RR: Not implemented yet\n"); + exit(1); + } + // If we will want to run net and local we will need to fork + // I guess we will get this way, therefore: + if (local) { + // TODO + // fork, in the child run the dbus interface + fprintf(stderr, "RR: Local configuration is not implemented yet\n"); + } #endif // Get our management agent