Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8b54a29c
Commit
8b54a29c
authored
May 09, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make this format again.
parent
acf0c345
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
Doc/lib/liboptparse.tex
Doc/lib/liboptparse.tex
+7
-5
No files found.
Doc/lib/liboptparse.tex
View file @
8b54a29c
...
...
@@ -278,14 +278,15 @@ parser.add_option("-f", "--file", ...)
The interesting stuff, of course, is what comes after the option
strings. For now, we'll only cover four of the things you can put
there:
\
var
{
action
}
,
\var
{
type
}
,
\var
{
dest
}
(destination), and
\
var
{
help
}
.
there:
\
emph
{
action
}
,
\emph
{
type
}
,
\emph
{
dest
}
(destination), and
\
emph
{
help
}
.
\subsubsection
{
The
\var
{
store
}
action
\label
{
optparse-store-action
}}
\subsubsection
{
The
\emph
{
store
}
action
%
\label
{
optparse-store-action
}}
The action tells
\module
{
optparse
}
what to do when it sees one of the
option strings for this option on the command-line. For example, the
action
\
var
{
store
}
means: take the next argument (or the remainder of
action
\
emph
{
store
}
means: take the next argument (or the remainder of
the current argument), ensure that it is of the correct type, and
store it to your chosen destination.
...
...
@@ -360,7 +361,8 @@ destination for \programopt{-f} is \var{f}.
Adding types is fairly easy; please refer to
section~
\ref
{
optparse-adding-types
}
, ``Adding new types.''
\subsubsection
{
Other
\var
{
store
_
*
}
actions
\label
{
optparse-other-store-actions
}}
\subsubsection
{
Other
\emph
{
store
_
*
}
actions
%
\label
{
optparse-other-store-actions
}}
Flag options---set a variable to true or false when a particular
option is seen---are quite common.
\module
{
optparse
}
supports them
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment