X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-config.c;h=80dde93f76da6b6fc54784ada31170a28cbb739e;hb=4be084408c6d3d7b7f90a2493829c8ce0cebb397;hp=347198da1c560b9e8322ac00c8a3bbb9cf4a1c05;hpb=b529ded85a3e50a1aa6529e870b2e2f43e377ca2;p=src%2Fapp-framework-binder.git diff --git a/src/afb-config.c b/src/afb-config.c index 347198da..80dde93f 100644 --- a/src/afb-config.c +++ b/src/afb-config.c @@ -16,7 +16,7 @@ */ #define _GNU_SOURCE -#define NO_BINDING_VERBOSE_MACRO +#define AFB_BINDING_PRAGMA_NO_VERBOSE_MACRO #include #include @@ -85,6 +85,7 @@ #define SET_NO_HTTPD 28 +#define ADD_CALL 'c' #define SET_TRACEDITF 'D' #define SET_EXEC 'e' #define DISPLAY_HELP 'h' @@ -97,7 +98,7 @@ #define SET_VERBOSE 'v' #define SET_WORK_DIR 'w' -#define SHORTOPTS "D:ehqrT:t:u:Vvw:" +#define SHORTOPTS "c:D:ehqrT:t:u:Vvw:" // Command line structure hold cli --command + help text typedef struct { @@ -151,6 +152,7 @@ static AFB_options cliOptions[] = { {SET_TRACEREQ, 1, "tracereq", "Log the requests: no, common, extra, all"}, {SET_TRACEDITF, 1, "traceditf", "Log the requests: no, common, extra, all"}, + {ADD_CALL, 1, "call", "call at start format of val: API/VERB:json-args"}, {SET_NO_HTTPD, 0, "no-httpd", "Forbids HTTP service"}, {SET_EXEC, 0, "exec", "Execute the remaining arguments"}, @@ -437,6 +439,10 @@ static void parse_arguments(int argc, char **argv, struct afb_config *config) list_add(&config->ldpaths, argvalstr(optc)); break; + case ADD_CALL: + list_add(&config->calls, argvalstr(optc)); + break; + case SET_SESSION_DIR: /* config->sessiondir = argvalstr(optc); */ WARNING("Obsolete otpion %s ignored", optname(optc)); @@ -559,13 +565,13 @@ static void config_set_default(struct afb_config *config) /* set directories */ if (config->workdir == NULL) - config->workdir = get_current_dir_name(); + config->workdir = "."; if (config->rootdir == NULL) - config->rootdir = config->workdir; + config->rootdir = "."; if (config->uploaddir == NULL) - config->uploaddir = config->workdir; + config->uploaddir = "."; // if no Angular/HTML5 rootbase let's try '/' as default if (config->rootbase == NULL) @@ -620,6 +626,7 @@ void afb_config_dump(struct afb_config *config) L(ws_servers) L(so_bindings) L(ldpaths) + L(calls) V(exec)