summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-01-08 16:05:51 (GMT)
committerFred Drake <fdrake@acm.org>2001-01-08 16:05:51 (GMT)
commit45b1d6a8314db3ba41e3d954efa5b9a352e3eec9 (patch)
tree59097092edb5c09d33ec5c775bb5fd6f48b63918
parente1fd5260eae99657afb817562d41e1f4ba245a54 (diff)
downloadcpython-45b1d6a8314db3ba41e3d954efa5b9a352e3eec9.zip
cpython-45b1d6a8314db3ba41e3d954efa5b9a352e3eec9.tar.gz
cpython-45b1d6a8314db3ba41e3d954efa5b9a352e3eec9.tar.bz2
Explain that long options are matched based on a unique prefix rather than
requiring the whole option to be typed out. This closes SF bug #126863.
-rw-r--r--Doc/lib/libgetopt.tex9
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/lib/libgetopt.tex b/Doc/lib/libgetopt.tex
index 6731c32..563460b 100644
--- a/Doc/lib/libgetopt.tex
+++ b/Doc/lib/libgetopt.tex
@@ -29,7 +29,14 @@ recognize, with options that require an argument followed by a colon
names of the long options which should be supported. The leading
\code{'-}\code{-'} characters should not be included in the option
name. Long options which require an argument should be followed by an
-equal sign (\character{=}).
+equal sign (\character{=}). To accept only long options,
+\var{options} should be an empty string. Long options on the command
+line can be recognized so long as they provide a prefix of the option
+name that matches exactly one of the accepted options. For example,
+it \var{long_options} is \code{['foo', 'frob']}, the option
+\longprogramopt{fo} will match as \longprogramopt{foo}, but
+\longprogramopt{f} will not match uniquely, so \exception{GetoptError}
+will be raised.
The return value consists of two elements: the first is a list of
\code{(\var{option}, \var{value})} pairs; the second is the list of