yanglint FEATURE debug dep-sets in interactive mod
diff --git a/tools/lint/cmd.c b/tools/lint/cmd.c
index 33734e6..3a7fba3 100644
--- a/tools/lint/cmd.c
+++ b/tools/lint/cmd.c
@@ -35,7 +35,7 @@
void
cmd_debug_help(void)
{
- printf("Usage: debug (dict | xpath)+\n");
+ printf("Usage: debug (dict | xpath | dep-sets)+\n");
}
void
@@ -75,6 +75,8 @@
dbg_groups |= LY_LDGDICT;
} else if (!strcasecmp("xpath", argv[optind + i])) {
dbg_groups |= LY_LDGXPATH;
+ } else if (!strcasecmp("dep-sets", argv[optind + i])) {
+ dbg_groups |= LY_LDGDEPSETS;
} else {
YLMSG_E("Unknown debug group \"%s\"\n", argv[optind + 1]);
goto cleanup;
diff --git a/tools/lint/completion.c b/tools/lint/completion.c
index 3448445..3b69389 100644
--- a/tools/lint/completion.c
+++ b/tools/lint/completion.c
@@ -363,6 +363,20 @@
get_arg_completion(hint, args, matches, match_count);
}
+#ifndef NDEBUG
+/**
+ * @copydoc get_print_format_arg
+ */
+static void
+get_debug_arg(const char *hint, char ***matches, unsigned int *match_count)
+{
+ const char *args[] = {"dict", "xpath", "dep-sets", NULL};
+
+ get_arg_completion(hint, args, matches, match_count);
+}
+
+#endif
+
/**
* @brief Get the string before the hint, which autocompletion is for.
*
@@ -425,6 +439,9 @@
{CMD_DATA, NULL, linenoisePathCompletion, NULL},
{CMD_LIST, NULL, NULL, get_list_format_arg},
{CMD_FEATURE, NULL, NULL, get_model_completion},
+#ifndef NDEBUG
+ {CMD_DEBUG, NULL, NULL, get_debug_arg},
+#endif
};
size_t name_len;
const char *last, *name, *getoptstr;