From: Guus Sliepen Date: Sun, 13 Apr 2014 11:16:28 +0000 (+0200) Subject: Allow configuration directory and node names to be specified on the command line. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=7e9daf73d401e3afd42f68ed20ff3d0e2e0a6a0a;p=meshlink Allow configuration directory and node names to be specified on the command line. --- diff --git a/meshlink-sample/meshlinkapp.c b/meshlink-sample/meshlinkapp.c index 0b494599..ff9bad1e 100644 --- a/meshlink-sample/meshlinkapp.c +++ b/meshlink-sample/meshlinkapp.c @@ -2,12 +2,12 @@ int main(int argc , char **argv){ -char *confbase = "/tmp/meshlink/"; -char *name = "test"; +char *confbase = argc > 1 ? argv[1] : "/tmp/meshlink/"; +char *name = argc > 2 ? argv[2] : "foo"; debug_level = 5; node_t* remotenode = new_node(); -char *remotename = "ml"; +char *remotename = argc > 3 ? argv[3] : "bar"; //TODO: change this, calling a function that returns node_t remotenode->name = malloc(16);