From patchwork Mon Feb 23 15:10:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng Renquan X-Patchwork-Id: 8415 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n1NFAKpY011202 for ; Mon, 23 Feb 2009 15:10:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755625AbZBWPKd (ORCPT ); Mon, 23 Feb 2009 10:10:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755598AbZBWPKd (ORCPT ); Mon, 23 Feb 2009 10:10:33 -0500 Received: from ti-out-0910.google.com ([209.85.142.188]:24359 "EHLO ti-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755625AbZBWPKb (ORCPT ); Mon, 23 Feb 2009 10:10:31 -0500 Received: by ti-out-0910.google.com with SMTP id d10so1553390tib.23 for ; Mon, 23 Feb 2009 07:10:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=bd0vcyWOOAUZQPSo7S+gPE5xHh7Eui5gLcGu4WooSSQ=; b=YDIv5goeNLBzaS8+VQ8j3jc8QsLZQZHMx+Oq4aLe20kbXWW6YCqU2kYsps2Ci0JqKb Xz3Al7HdLr9GGtUDvdv6gdPcWwFDoyjBRHSdJDvv0v2gd6PmDAcgCoqb0cv/nSnMWKc0 lzSvRn0AkE5XkUa+MDdNqpaF/1zLIApyv5jpU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=W8nS3Onl1uxNFfuifT8J9Kvhozpc6WmRvPXR0SMkxXlCjOtKytMzkkoYN4KZq1sTJw bT3dC9L1YjdnQBxBxj3QgujPT3J+Jz/ezlbAd0HdvTouYjTwcnYTeUMUhojdo8fCFMul OFP0UalpZgIvcIYICTA/rTI1tzJgZig3NYlTc= Received: by 10.110.33.15 with SMTP id g15mr5890843tig.58.1235401830694; Mon, 23 Feb 2009 07:10:30 -0800 (PST) Received: from localhost.localdomain ([59.40.122.219]) by mx.google.com with ESMTPS id j5sm715564tid.21.2009.02.23.07.10.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Feb 2009 07:10:29 -0800 (PST) From: Cheng Renquan To: Randy Dunlap , Sam Ravnborg , Roman Zippel Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, cr_quan@163.com Subject: [PATCH 6/6] [KBUILD] make use of menu_get_ext_help in "make config" Date: Mon, 23 Feb 2009 23:10:04 +0800 Message-Id: <1235401804-8136-7-git-send-email-crquan@gmail.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1235401804-8136-6-git-send-email-crquan@gmail.com> References: <1235401804-8136-1-git-send-email-crquan@gmail.com> <1235401804-8136-2-git-send-email-crquan@gmail.com> <1235401804-8136-3-git-send-email-crquan@gmail.com> <1235401804-8136-4-git-send-email-crquan@gmail.com> <1235401804-8136-5-git-send-email-crquan@gmail.com> <1235401804-8136-6-git-send-email-crquan@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Signed-off-by: Cheng Renquan --- scripts/kconfig/conf.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 3e1057f..8ec35c9 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -37,14 +37,14 @@ static int conf_cnt; static char line[128]; static struct menu *rootEntry; -static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); - -static const char *get_help(struct menu *menu) +static void print_help(struct menu *menu) { - if (menu_has_help(menu)) - return _(menu_get_help(menu)); - else - return nohelp_text; + struct gstr help = str_new(); + + menu_get_ext_help(menu, &help); + + printf("\n%s\n", str_get(&help)); + str_free(&help); } static void strip(char *str) @@ -139,7 +139,7 @@ int conf_string(struct menu *menu) case '?': /* print help */ if (line[1] == '\n') { - printf("\n%s\n", get_help(menu)); + print_help(menu); def = NULL; break; } @@ -219,7 +219,7 @@ static int conf_sym(struct menu *menu) if (sym_set_tristate_value(sym, newval)) return 0; help: - printf("\n%s\n", get_help(menu)); + print_help(menu); } } @@ -306,7 +306,7 @@ static int conf_choice(struct menu *menu) fgets(line, 128, stdin); strip(line); if (line[0] == '?') { - printf("\n%s\n", get_help(menu)); + print_help(menu); continue; } if (!line[0]) @@ -330,7 +330,7 @@ static int conf_choice(struct menu *menu) if (!child) continue; if (line[strlen(line) - 1] == '?') { - printf("\n%s\n", get_help(child)); + print_help(child); continue; } sym_set_choice_value(sym, child->sym);