From: Inga Stotland Date: Thu, 3 Sep 2020 20:00:52 +0000 (-0700) Subject: mesh: Align option names with functionality X-Git-Tag: submit/tizen/20210127.232224~2^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2dafcb5bb12d6564a8bb37317e9603d89da99d9;p=platform%2Fupstream%2Fbluez.git mesh: Align option names with functionality Change option "config" ('c') to "storage" ('s) to specify a custom storage directory for node configuration. Change option 'f' (long name was missing) to "config" ('c') to specify a custom mesh configuration file to override the default mesh-main.conf Change-Id: Idcf869faed62bdf401c9994754589698eeade2a6 Signed-off-by: anuj.bhumiya --- diff --git a/mesh/main.c b/mesh/main.c index e90f5c45..c4b9e739 100644 --- a/mesh/main.c +++ b/mesh/main.c @@ -38,7 +38,7 @@ #include "mesh/mesh-io.h" #include "mesh/util.h" -static const char *config_dir; +static const char *storage_dir; static const char *mesh_conf_fname; static enum mesh_io_type io_type; static void *io_opts; @@ -48,7 +48,8 @@ bool use_raw = false; static const struct option main_options[] = { { "io", required_argument, NULL, 'i' }, - { "config", optional_argument, NULL, 'c' }, + { "storage", required_argument, NULL, 's' }, + { "config", required_argument, NULL, 'c' }, { "nodetach", no_argument, NULL, 'n' }, { "debug", no_argument, NULL, 'd' }, { "dbus-debug", no_argument, NULL, 'b' }, @@ -113,7 +114,7 @@ static void request_name_callback(struct l_dbus *dbus, bool success, return; } - if (!mesh_init(config_dir, mesh_conf_fname, io_type, io_opts, + if (!mesh_init(storage_dir, mesh_conf_fname, io_type, io_opts, mesh_ready_callback, dbus)) { l_error("Failed to initialize mesh"); l_main_quit(); @@ -209,7 +210,7 @@ int main(int argc, char *argv[]) #ifdef TIZEN_FEATURE_BLUEZ_MODIFY opt = getopt_long(argc, argv, "i:c:f:ndbhr", main_options, NULL); #else - opt = getopt_long(argc, argv, "i:c:f:ndbh", main_options, NULL); + opt = getopt_long(argc, argv, "i:s:c:ndbh", main_options, NULL); #endif if (opt < 0) break; @@ -228,10 +229,10 @@ int main(int argc, char *argv[]) case 'd': enable_debug(); break; - case 'c': - config_dir = optarg; + case 's': + storage_dir = optarg; break; - case 'f': + case 'c': mesh_conf_fname = optarg; break; case 'b':