public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] manual: Clarify that abbreviations of long options are allowed
@ 2022-05-03  4:57 Siddhesh Poyarekar
  2022-05-03  5:13 ` Florian Weimer
  2022-05-03  7:36 ` Andreas Schwab
  0 siblings, 2 replies; 5+ messages in thread
From: Siddhesh Poyarekar @ 2022-05-03  4:57 UTC (permalink / raw)
  To: 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 <siddhesh@sourceware.org>
---
 manual/getopt.texi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/manual/getopt.texi b/manual/getopt.texi
index 5485fc4694..e58283ab88 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 or is an exact match for some defined option.
 
 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
-- 
2.35.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] manual: Clarify that abbreviations of long options are allowed
  2022-05-03  4:57 [PATCH] manual: Clarify that abbreviations of long options are allowed Siddhesh Poyarekar
@ 2022-05-03  5:13 ` Florian Weimer
  2022-05-03  7:36 ` Andreas Schwab
  1 sibling, 0 replies; 5+ messages in thread
From: Florian Weimer @ 2022-05-03  5:13 UTC (permalink / raw)
  To: Siddhesh Poyarekar via Libc-alpha; +Cc: Siddhesh Poyarekar

* Siddhesh Poyarekar via 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 <siddhesh@sourceware.org>
> ---
>  manual/getopt.texi | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/manual/getopt.texi b/manual/getopt.texi
> index 5485fc4694..e58283ab88 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 or is an exact match for some defined option.
>  
>  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

Looks okay.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] manual: Clarify that abbreviations of long options are allowed
  2022-05-03  4:57 [PATCH] manual: Clarify that abbreviations of long options are allowed Siddhesh Poyarekar
  2022-05-03  5:13 ` Florian Weimer
@ 2022-05-03  7:36 ` Andreas Schwab
  2022-05-04  2:56   ` Siddhesh Poyarekar
  1 sibling, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2022-05-03  7:36 UTC (permalink / raw)
  To: Siddhesh Poyarekar via Libc-alpha; +Cc: Siddhesh Poyarekar

On Mai 03 2022, Siddhesh Poyarekar via Libc-alpha wrote:

> diff --git a/manual/getopt.texi b/manual/getopt.texi
> index 5485fc4694..e58283ab88 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 or is an exact match for some defined option.

If it's an exact match, it isn't an abbreviation?

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] manual: Clarify that abbreviations of long options are allowed
  2022-05-03  7:36 ` Andreas Schwab
@ 2022-05-04  2:56   ` Siddhesh Poyarekar
  2022-05-04  7:38     ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Siddhesh Poyarekar @ 2022-05-04  2:56 UTC (permalink / raw)
  To: Andreas Schwab, Siddhesh Poyarekar via Libc-alpha

On 03/05/2022 13:06, Andreas Schwab wrote:
> On Mai 03 2022, Siddhesh Poyarekar via Libc-alpha wrote:
> 
>> diff --git a/manual/getopt.texi b/manual/getopt.texi
>> index 5485fc4694..e58283ab88 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 or is an exact match for some defined option.
> 
> If it's an exact match, it isn't an abbreviation?
> 

So just the following?

The option name may be abbreviated as long as the abbreviation is unique.

Thanks,
Siddhesh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] manual: Clarify that abbreviations of long options are allowed
  2022-05-04  2:56   ` Siddhesh Poyarekar
@ 2022-05-04  7:38     ` Andreas Schwab
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2022-05-04  7:38 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: Siddhesh Poyarekar via Libc-alpha

On Mai 04 2022, Siddhesh Poyarekar wrote:

> The option name may be abbreviated as long as the abbreviation is unique.

Ok.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-04  7:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03  4:57 [PATCH] manual: Clarify that abbreviations of long options are allowed Siddhesh Poyarekar
2022-05-03  5:13 ` Florian Weimer
2022-05-03  7:36 ` Andreas Schwab
2022-05-04  2:56   ` Siddhesh Poyarekar
2022-05-04  7:38     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).