afb-api-js: first step for javascript bindings
[src/app-framework-binder.git] / src / afb-args.c
index ed14a73..8f9e42c 100644 (file)
 #define SET_NAME           'n'
 #define SET_OUTPUT         'o'
 #define SET_PORT           'p'
+#define JS_API             'j'
 #define SET_QUIET          'q'
 #define SET_RANDOM_TOKEN   'r'
 #define ADD_SET            's'
@@ -183,6 +184,8 @@ static struct option_desc optdefs[] = {
        {ADD_WEAK_LDPATH,     1, "weak-ldpaths","Same as --ldpaths but ignore errors"},
        {SET_NO_LDPATH,       0, "no-ldpaths",  "Discard default ldpaths loading"},
 #endif
+       {JS_API,              1, "jsapi",       "Load the javascript api of path"},
+
        {SET_TOKEN,           1, "token",       "Initial Secret [default=random, use --token="" to allow any token]"},
        {SET_RANDOM_TOKEN,    0, "random-token","Enforce a random token"},
 
@@ -366,7 +369,7 @@ static void printVersion(FILE * file)
 #endif
                "HOOK "
 
-#if WITH_TRACE
+#if WITH_AFB_TRACE
                "+"
 #else
                "-"
@@ -375,29 +378,21 @@ static void printVersion(FILE * file)
 
                "["
 #if WITH_DYNAMIC_BINDING
-               "BINDINGS "
                "+"
 #else
                "-"
 #endif
+               "BINDINGS "
 #if WITH_LEGACY_BINDING_V1
-               "+"
-#else
-               "-"
+               "+V1 "
 #endif
-               "V1 "
 #if WITH_LEGACY_BINDING_VDYN
-               "+"
-#else
-               "-"
+               "+VDYN "
 #endif
-               "VDYN "
 #if WITH_LEGACY_BINDING_V2
-               "+"
-#else
-               "-"
+               "+V2 "
 #endif
-               "V2 +V3]\n"
+               "+V3]\n"
                "\n",
                AFB_VERSION
        );
@@ -849,6 +844,7 @@ static void parse_arguments_inner(int argc, char **argv, struct json_object *con
                case ADD_WS_CLIENT:
                case ADD_WS_SERVICE:
                case ADD_AUTO_API:
+               case JS_API:
                        config_add_optstr(config, optid);
                        break;