public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Documentation update for getopt
@ 1999-12-29  6:07 Andreas Jaeger
  0 siblings, 0 replies; only message in thread
From: Andreas Jaeger @ 1999-12-29  6:07 UTC (permalink / raw)
  To: GNU libc hacker

Here's an update of the documentation of getopt.

Andreas

1999-12-29  Andreas Jaeger  <aj@suse.de>

	* manual/getopt.texi (Using Getopt): Document ordering of
	options.

============================================================
Index: manual/getopt.texi
--- manual/getopt.texi	1999/03/19 02:17:38	2.2
+++ manual/getopt.texi	1999/12/29 13:58:31
@@ -71,9 +71,28 @@
 required argument.  If an option character is followed by two colons
 (@samp{::}), its argument is optional; this is a GNU extension.
 
+@code{getopt} has three ways to deal with options that follow
+non-options @var{argv} elements.  The special argument @samp{--} forces
+in all cases the end of option scanning.
+
+@itemize @bullet
+@item
+The default is to permute the contents of @var{argv} while scanning it
+so that eventually all the non-options are at the end.  This allows
+options to be given in any order, even with programs that were not
+written to expect this.
+
+@item
 If the @var{options} argument string begins with a hyphen (@samp{-}), this
 is treated specially.  It permits arguments that are not options to be
 returned as if they were associated with option character @samp{\0}.
+
+@item
+POSIX demands the following behaviour: The first non-option stops option
+processing.  This mode is selected by either setting the environment
+variable @code{POSIXLY_CORRECT} or beginning the @var{options} argument
+string with a plus sign (@samp{+}).
+@end itemize
 
 The @code{getopt} function returns the option character for the next
 command line option.  When no more option arguments are available, it

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-12-29  6:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-29  6:07 Documentation update for getopt Andreas Jaeger

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).