]> git.ipfire.org Git - thirdparty/lldpd.git/blobdiff - src/client/lldpcli.c
lldpcli: document json0 output format
[thirdparty/lldpd.git] / src / client / lldpcli.c
index 9f1380a40be22d9ad58050ef550ad6c50a94f0ab..a7d9be4b4b20baf35433b0bf2283b013bc7167f9 100644 (file)
@@ -68,12 +68,9 @@ usage()
 
        fprintf(stderr, "-d          Enable more debugging information.\n");
        fprintf(stderr, "-u socket   Specify the Unix-domain socket used for communication with lldpd(8).\n");
-       fprintf(stderr, "-f format   Choose output format (plain, keyvalue"
+       fprintf(stderr, "-f format   Choose output format (plain, keyvalue, json, json0"
 #if defined USE_XML
            ", xml"
-#endif
-#if defined USE_JANSSON || defined USE_JSONC
-           ", json"
 #endif
            ").\n");
        if (!is_lldpctl(NULL))
@@ -275,14 +272,10 @@ cmd_exec(lldpctl_conn_t *conn, const char *fmt, int argc, const char **argv)
 
        if      (strcmp(fmt, "plain")    == 0) w = txt_init(stdout);
        else if (strcmp(fmt, "keyvalue") == 0) w = kv_init(stdout);
+       else if (strcmp(fmt, "json")     == 0) w = json_init(stdout, 1);
+       else if (strcmp(fmt, "json0")    == 0) w = json_init(stdout, 0);
 #ifdef USE_XML
        else if (strcmp(fmt, "xml")      == 0) w = xml_init(stdout);
-#endif
-#ifdef USE_JANSSON
-       else if (strcmp(fmt, "json")     == 0) w = jansson_init(stdout);
-#endif
-#ifdef USE_JSONC
-       else if (strcmp(fmt, "json")     == 0) w = jsonc_init(stdout);
 #endif
        else {
                log_warnx("lldpctl", "unknown output format \"%s\"", fmt);