#define SET_NO_HTTPD 28
+#define ADD_CALL 'c'
+#define SET_TRACEDITF 'D'
#define SET_EXEC 'e'
#define DISPLAY_HELP 'h'
#define SET_QUIET 'q'
#define SET_VERBOSE 'v'
#define SET_WORK_DIR 'w'
-#define SHORTOPTS "ehqrT:t:u:Vvw:"
+#define SHORTOPTS "c:D:ehqrT:t:u:Vvw:"
// Command line structure hold cli --command + help text
typedef struct {
{SET_SESSIONMAX, 1, "session-max", "Max count of session simultaneously [default 10]"},
{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"},
{ NULL, 0 }
};
+static struct enumdesc traceditf_desc[] = {
+ { "no", 0 },
+ { "common", afb_hook_flags_ditf_common },
+ { "extra", afb_hook_flags_ditf_extra },
+ { "all", afb_hook_flags_ditf_all },
+ { NULL, 0 }
+};
+
static struct enumdesc mode_desc[] = {
{ "local", AFB_MODE_LOCAL },
{ "remote", AFB_MODE_REMOTE },
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));
config->tracereq = argvalenum(optc, tracereq_desc);
break;
+ case SET_TRACEDITF:
+ config->traceditf = argvalenum(optc, traceditf_desc);
+ break;
+
case SET_NO_HTTPD:
noarg(optc);
config->noHttpd = 1;
/* 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)
L(ws_servers)
L(so_bindings)
L(ldpaths)
+ L(calls)
V(exec)
D(nbSessionMax)
E(mode,mode_desc)
E(tracereq,tracereq_desc)
+ E(traceditf,traceditf_desc)
B(noHttpd)
P("---END-OF-CONFIG---\n");