diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-06-20 20:51:04 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-08-14 22:02:05 +0200 |
commit | ed8841d3fb5af79fae6786d93ebbbff681d4d6bf (patch) | |
tree | 97027f642364bef76f533ad9ec200b520bcf1399 /vtysh/vtysh.c | |
parent | babeld: fix erroneous lib init (diff) | |
download | frr-ed8841d3fb5af79fae6786d93ebbbff681d4d6bf.tar.xz frr-ed8841d3fb5af79fae6786d93ebbbff681d4d6bf.zip |
lib: add 'show error all json'
* Add 'all' option
* Add 'json' option
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vtysh/vtysh.c')
-rw-r--r-- | vtysh/vtysh.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 540e30e44..63195806e 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -45,6 +45,7 @@ #include "libfrr.h" #include "command_graph.h" #include "frrstr.h" +#include "json.h" DEFINE_MTYPE_STATIC(MVTYSH, VTYSH_CMD, "Vtysh cmd copy") @@ -2346,17 +2347,23 @@ DEFUN (vtysh_show_debugging_hashtable, DEFUN (vtysh_show_error_code, vtysh_show_error_code_cmd, - "show error (0-4294967296)", + "show error <(1-4294967296)|all> [json]", SHOW_STR "Information on errors\n" - "Error code to get info about\n") + "Error code to get info about\n" + "Information on all errors\n" + JSON_STR) { char cmd[256]; - - snprintf(cmd, sizeof(cmd), "do show error %s", argv[2]->arg); + int rv; + char *fcmd = argv_concat(argv, argc, 0); + snprintf(cmd, sizeof(cmd), "do %s", fcmd); /* FIXME: Needs to determine which daemon to send to via code ranges */ - return show_per_daemon(cmd, ""); + rv = show_per_daemon(cmd, ""); + + XFREE(MTYPE_TMP, fcmd); + return rv; } /* Memory */ |