diff options
Diffstat (limited to 'lib/vty.c')
| -rw-r--r-- | lib/vty.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -284,7 +284,8 @@ done: return len; } -int vty_json(struct vty *vty, struct json_object *json) +static int vty_json_helper(struct vty *vty, struct json_object *json, + uint32_t options) { const char *text; @@ -299,6 +300,18 @@ int vty_json(struct vty *vty, struct json_object *json) return CMD_SUCCESS; } +int vty_json(struct vty *vty, struct json_object *json) +{ + return vty_json_helper(vty, json, + JSON_C_TO_STRING_PRETTY | + JSON_C_TO_STRING_NOSLASHESCAPE); +} + +int vty_json_no_pretty(struct vty *vty, struct json_object *json) +{ + return vty_json_helper(vty, json, JSON_C_TO_STRING_NOSLASHESCAPE); +} + /* Output current time to the vty. */ void vty_time_print(struct vty *vty, int cr) { |
