From patchwork Wed May 4 10:27:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 53451 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C9C1B385735E for ; Wed, 4 May 2022 10:28:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9C1B385735E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651660095; bh=qwmjRlozGrD26Fbj5PESrWZWVeRL4cI9X8oCYiZrPUc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Mvzf67OqqS9hFKtSBpRyCEbMmOrfRaqId3r7QKRgr5Nvryd4WR9qZmGD5JeqbOxg/ 5/kKgDviDwdjmRAXLUi5PaK5QBJuXw7WcxdYPi92rdGbfSf1aHfnA8k+d910PIdTDF KGzNaVSSEIRVyTDmmN5gd/WTDPfYPOYW8T4NiA8s= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hamster.birch.relay.mailchannels.net (hamster.birch.relay.mailchannels.net [23.83.209.80]) by sourceware.org (Postfix) with ESMTPS id 0A26C3858010 for ; Wed, 4 May 2022 10:27:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0A26C3858010 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B3B6F5A0EE9; Wed, 4 May 2022 10:27:52 +0000 (UTC) Received: from pdx1-sub0-mail-a305.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 53B325A0864; Wed, 4 May 2022 10:27:52 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1651660072; a=rsa-sha256; cv=none; b=NrP6MfM3Olrz2U/Ssn4kY9Y8Ylc9LWvqaCjqleYl5toSNT58Nr6GAJrjX/MgKa+o02XUWh a58n5NQ62rWHhdDgE/3DIRRkfrUluCBPFFp7RsrY+ojxL3NQ29m//k8XkrSqzJXLvRgVoy wNI8ECxzQoc+0DR1A92lfat8pPuzqnqprYiDgkHTT06FTI2tjAtQGC+F8KA0xhbUMLZfSh T5mYjcT/yFd3+WMhayVFff2Oer0SJJYQP4YmrQROyW2wP7yXE2YdpvUC9UXDUh5ihaHE8m 6g5uZ6MvjAxfr54INcEDEY/Lx0B/47I8nkf8veOb+z1EMiOIoWu044vzNypQ2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1651660072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qwmjRlozGrD26Fbj5PESrWZWVeRL4cI9X8oCYiZrPUc=; b=3MiH+/TgIrPMT4zUlFXP4Kqmi9W8lwzD45jAfNoF4azjPuPIZYvfwRQ4BnjietGc7g79Ec Yfbo7YRzPByl2ZWEUuJjzXr0GEMkzkQKTCx4eYN+5kix9EK4yHUtgfHX/EEZzAJ0HGXlMB h0z0vA8sNf0AY6BQD/fV3+2iVfxh1+mwvmoMb3U/tmL7pVlWoEAGq6aZ7Aw+ToV9irYVlc yluEyjGv+lvLVkNOxaxMgUSu3Hu89wDpq8lmoavB6MkVJGmvDQoGDIi9tsyAkY+Dkh/57V 0yT+bE9DJuF+xKF7UGKAJ5Ohv02IKPlLF9BaZ6FEJ6WiAcqJKc5Ips25y7JBaw== ARC-Authentication-Results: i=1; rspamd-847dd8955c-l4jqt; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@sourceware.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Invention-Oafish: 31c68b1b05c561b3_1651660072594_2108810403 X-MC-Loop-Signature: 1651660072594:381654169 X-MC-Ingress-Time: 1651660072593 Received: from pdx1-sub0-mail-a305.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.115.45.49 (trex/6.7.1); Wed, 04 May 2022 10:27:52 +0000 Received: from rhbox.redhat.com (unknown [1.186.223.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a305.dreamhost.com (Postfix) with ESMTPSA id 4KtY1f1R6Rz24; Wed, 4 May 2022 03:27:49 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [committed] manual: Clarify that abbreviations of long options are allowed Date: Wed, 4 May 2022 15:57:41 +0530 Message-Id: <20220504102741.2902476-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3493.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Siddhesh Poyarekar via Libc-alpha From: Siddhesh Poyarekar Reply-To: Siddhesh Poyarekar Cc: Florian Weimer , Andreas Schwab Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The man page and code comments clearly state that abbreviations of long option names are recognized correctly as long as they are unique. Document this fact in the glibc manual as well. Signed-off-by: Siddhesh Poyarekar Reviewed-by: Florian Weimer Reviewed-by: Andreas Schwab --- manual/getopt.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manual/getopt.texi b/manual/getopt.texi index 5485fc4694..b4c0b15ac2 100644 --- a/manual/getopt.texi +++ b/manual/getopt.texi @@ -250,7 +250,8 @@ option, and stores the option's argument (if it has one) in @code{optarg}. When @code{getopt_long} encounters a long option, it takes actions based on the @code{flag} and @code{val} fields of the definition of that -option. +option. The option name may be abbreviated as long as the abbreviation is +unique. If @code{flag} is a null pointer, then @code{getopt_long} returns the contents of @code{val} to indicate which option it found. You should