From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bert Wesarg Subject: [PATCH 1/2] grep: do not use --index in the short usage output Date: Thu, 15 Sep 2011 20:26:02 +0200 Message-ID: <2f376e61802a1a38c67698d5ec263d1807b1fcee.1316110876.git.bert.wesarg@googlemail.com> Cc: git@vger.kernel.org, Bert Wesarg To: Junio C Hamano X-From: git-owner@vger.kernel.org Thu Sep 15 20:26:16 2011 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R4Gdb-00067S-PO for gcvg-git-2@lo.gmane.org; Thu, 15 Sep 2011 20:26:16 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934363Ab1IOS0K (ORCPT ); Thu, 15 Sep 2011 14:26:10 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:63180 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934275Ab1IOS0I (ORCPT ); Thu, 15 Sep 2011 14:26:08 -0400 Received: by eya28 with SMTP id 28so531024eya.19 for ; Thu, 15 Sep 2011 11:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=Wbr7ncY9owoZEuHMSjclOXWYqkQ9qQtyIEA3FZ1npUk=; b=U7OrMhEVqMq0jknO6sZBa5CV4o4KsIN90ysbVrTwYknNiuw98wdwicJxjCXz3r0mvd Kv1FZtx5rtPeHlDO8bqdx1O7DGfxivFhtr0gsZzcG9khA7dFqq6D59yDsL50dIfvp7XL dR2UkDUyQy+0dDNxnGGBUuWuskUR/O6TJkpcE= Received: by 10.204.142.146 with SMTP id q18mr955836bku.384.1316111167652; Thu, 15 Sep 2011 11:26:07 -0700 (PDT) Received: from localhost (p5B2AB10E.dip.t-dialin.net. [91.42.177.14]) by mx.google.com with ESMTPS id t18sm4143488bkb.9.2011.09.15.11.26.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Sep 2011 11:26:06 -0700 (PDT) X-Mailer: git-send-email 1.7.6.789.gb4599 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Utilize the PARSE_OPT_NEGHELP option to show --no-index in the usage generated by parse-options. Signed-off-by: Bert Wesarg --- builtin/grep.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c index 1c359c2..e0562b0 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -774,8 +774,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix) struct option options[] = { OPT_BOOLEAN(0, "cached", &cached, "search in index instead of in the work tree"), - OPT_BOOLEAN(0, "index", &use_index, - "--no-index finds in contents not managed by git"), + { OPTION_BOOLEAN, 0, "index", &use_index, NULL, + "finds in contents not managed by git", + PARSE_OPT_NOARG | PARSE_OPT_NEGHELP }, OPT_GROUP(""), OPT_BOOLEAN('v', "invert-match", &opt.invert, "show non-matching lines"), -- 1.7.6.789.gb4599