kconfig: distinguish between dependencies and visibility in help text
[carl9170fw.git] / config / menu.c
index b4fb0c88b6e0e0672b03053a71a98aec96a38e3b..da50f79a8e8db59f1995c8875fbdcbff41aa646d 100644 (file)
@@ -736,6 +736,17 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
        str_printf(r, "  Prompt: %s\n", prop->text);
 
        get_dep_str(r, prop->menu->dep, "  Depends on: ");
+       /*
+        * Most prompts in Linux have visibility that exactly matches their
+        * dependencies. For these, we print only the dependencies to improve
+        * readability. However, prompts with inline "if" expressions and
+        * prompts with a parent that has a "visible if" expression have
+        * differing dependencies and visibility. In these rare cases, we
+        * print both.
+        */
+       if (!expr_eq(prop->menu->dep, prop->visible.expr))
+               get_dep_str(r, prop->visible.expr, "  Visible if: ");
+
        menu = prop->menu->parent;
        for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
                bool accessible = menu_is_visible(menu);