Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8944002ybi; Tue, 23 Jul 2019 18:35:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5GA5PwD/HeZ5lVWXZKPOgQ8jak1AcguYYHTFcy1+tApF5gZYTVIvnZ3qDtFhaewO34xcT X-Received: by 2002:a17:902:b688:: with SMTP id c8mr82163940pls.243.1563932149632; Tue, 23 Jul 2019 18:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563932149; cv=none; d=google.com; s=arc-20160816; b=oldYd47wSkwPlPrSS3crrTnqIXjKP5oiBwAdL0Y+SvFAE0/f0ItbiGXT5Y5u01u4ht OitRViixiuidO+7QtJDdG8Gb2xzDn5sDxWNHbEDADl8FNn1LDfZZJ+fj52b3KkeHYQ3H i7FJ8y50RJR76Fd3x5wiUEpqpIkGyMw+jSkgYkc1QGzmyvB0heOxIERnGlZADtHX+Z3M /HcCi6DFbLYUhPFWnynV9zAh6LvUgqN2yaPwMV+yUhW6mReRVSxlarPM7R8FGBmIrEie Pniy1na5jwoUC+wheLqMHqvjQBwSa/l2oJW8LlKucVlrnsHj+pAvm+/V0PiuYd+Sy/iO vG/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date; bh=3EpcRsruz7TCGU8dnAZAmRHdNr9AGDpCBEPkB3vl/PQ=; b=gUM6GreOTtL0pbnZg1B2+3LWJbD9JSSkt/lkqNm/xZLcSj8WC3FNvQ1wRkz7dEstrw gyUbyLHdh8PhGTDDnDBHrBUB57URzdz9CksMKwGBKJbopjuU/B5lLGrortummqCeYr34 ytF8ycQIsRKWjZjpDa6FAz05HxMxd9g5QmK2SrSPOZIY51HVnAI+IpCPrsKfoqtJOUGr s26dUox6SspoNETJ9Sfg5EUweN/0n/LphdyyZ6+/N2F+jYWYEAtAvmsSSsnw4b8LJH1V 0+YVAV9t3kNiBPCCMU7oCP3BuDlSzFFnHAXKtN+MZcc9B3gqRMO2u/op69oiweIPl5Xp D1Ng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p4si12624417pgh.350.2019.07.23.18.35.24; Tue, 23 Jul 2019 18:35:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732174AbfGWQgH (ORCPT + 99 others); Tue, 23 Jul 2019 12:36:07 -0400 Received: from fieldses.org ([173.255.197.46]:34234 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728505AbfGWQgH (ORCPT ); Tue, 23 Jul 2019 12:36:07 -0400 Received: by fieldses.org (Postfix, from userid 2815) id D88372011; Tue, 23 Jul 2019 12:36:06 -0400 (EDT) Date: Tue, 23 Jul 2019 12:36:06 -0400 To: Yongcheng Yang Cc: "J . Bruce Fields" , linux-nfs@vger.kernel.org Subject: Re: [PATCH 1/2] nfs4_getfacl: return 1 for unknown option and won't use '-?' anymore Message-ID: <20190723163606.GA16908@fieldses.org> References: <20190723062713.20570-1-yongcheng.yang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190723062713.20570-1-yongcheng.yang@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, Jul 23, 2019 at 02:27:12PM +0800, Yongcheng Yang wrote: > The getopt_long() function will return '?' if encounters an option > character that was not in optstring. So it's impossible to tell the > option '-?' from an unrecognized option. Don't mention it in Usage. Thanks, both patches applied.--b. > > Signed-off-by: Yongcheng Yang > --- > nfs4_getfacl/nfs4_getfacl.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/nfs4_getfacl/nfs4_getfacl.c b/nfs4_getfacl/nfs4_getfacl.c > index 4df2b04..2f57866 100644 > --- a/nfs4_getfacl/nfs4_getfacl.c > +++ b/nfs4_getfacl/nfs4_getfacl.c > @@ -88,10 +88,14 @@ int main(int argc, char **argv) > case 'c': > ignore_comment = 1; > break; > - default: > + case 'h': > usage(1); > res = 0; > goto out; > + case '?': > + default: > + usage(0); > + goto out; > } > } > > @@ -131,7 +135,7 @@ static void usage(int label) > { > if (label) > fprintf(stderr, "%s %s -- get NFSv4 file or directory access control lists.\n", execname, VERSION); > - fprintf(stderr, "Usage: %s [-R] file ...\n -H, --more-help\tdisplay ACL format information\n -?, -h, --help\tdisplay this help text\n -R --recursive\trecurse into subdirectories\n -c, --omit-header\tDo not display the comment header (Do not print filename)\n", execname); > + fprintf(stderr, "Usage: %s [-R] file ...\n -H, --more-help\tdisplay ACL format information\n -h, --help\tdisplay this help text\n -R --recursive\trecurse into subdirectories\n -c, --omit-header\tDo not display the comment header (Do not print filename)\n", execname); > } > > static void more_help() > -- > 2.20.1