aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-config.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-08-29 11:22:49 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-08-29 11:22:49 +0200
commit9bc48026a93e8330a2bd2795e78d5951c16b7d33 (patch)
treee4a182f2ed5c43ebc2007f18fd813e21323e7184 /src/afb-config.c
parent33c28e126df60d8f7c416e762314d9da79f53448 (diff)
Add option --name for naming the process
This option allows to set the command line and the thread name of the main process. The value can contain spaces that will be replaced by nulls. Change-Id: I895270a24663467b16fb3cd8fc3218b7b003b6bb Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-config.c')
-rw-r--r--src/afb-config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/afb-config.c b/src/afb-config.c
index 25f44cd8..d906bcb7 100644
--- a/src/afb-config.c
+++ b/src/afb-config.c
@@ -90,6 +90,7 @@
#if defined(WITH_MONITORING_OPTION)
#define SET_MONITORING 'M'
#endif
+#define SET_NAME 'n'
#define SET_TCP_PORT 'p'
#define SET_QUIET 'q'
#define SET_RNDTOKEN 'r'
@@ -102,7 +103,7 @@
#define SET_WORK_DIR 'w'
const char shortopts[] =
- "c:D:E:ehp:qrT:t:u:Vvw:"
+ "c:D:E:ehn:p:qrT:t:u:Vvw:"
#if defined(WITH_MONITORING_OPTION)
"M"
#endif
@@ -125,6 +126,8 @@ static AFB_options cliOptions[] = {
{SET_FORGROUND, 0, "foreground", "Get all in foreground mode"},
{SET_BACKGROUND, 0, "daemon", "Get all in background mode"},
+ {SET_NAME, 1, "name", "Set the visible name"},
+
{SET_TCP_PORT, 1, "port", "HTTP listening TCP port [default 1234]"},
{SET_ROOT_HTTP, 1, "roothttp", "HTTP Root Directory [default no root http (files not served but apis still available)]"},
{SET_ROOT_BASE, 1, "rootbase", "Angular Base Root URL [default /opa]"},
@@ -512,6 +515,10 @@ static void parse_arguments(int argc, char **argv, struct afb_config *config)
config->background = 1;
break;
+ case SET_NAME:
+ config->name = argvalstr(optc);
+ break;
+
case SET_MODE:
config->mode = argvalenum(optc, mode_desc);
break;
@@ -674,6 +681,7 @@ void afb_config_dump(struct afb_config *config)
S(workdir)
S(uploaddir)
S(token)
+ S(name)
L(aliases)
L(dbus_clients)