Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
94c1467b
Kaydet (Commit)
94c1467b
authored
Eki 06, 2013
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge with 3.3
üst
af1edb7f
fc9a1134
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
argparse.rst
Doc/library/argparse.rst
+28
-1
No files found.
Doc/library/argparse.rst
Dosyayı görüntüle @
94c1467b
...
@@ -1452,7 +1452,10 @@ Other utilities
...
@@ -1452,7 +1452,10 @@ Other utilities
Sub-commands
Sub-commands
^^^^^^^^^^^^
^^^^^^^^^^^^
.. method:: ArgumentParser.add_subparsers()
.. method:: ArgumentParser.add_subparsers([title], [description], [prog], \
[parser_class], [action], \
[option_string], [dest], [help], \
[metavar])
Many programs split up their functionality into a number of sub-commands,
Many programs split up their functionality into a number of sub-commands,
for example, the ``svn`` program can invoke sub-commands like ``svn
for example, the ``svn`` program can invoke sub-commands like ``svn
...
@@ -1466,6 +1469,30 @@ Sub-commands
...
@@ -1466,6 +1469,30 @@ Sub-commands
command name and any :class:`ArgumentParser` constructor arguments, and
command name and any :class:`ArgumentParser` constructor arguments, and
returns an :class:`ArgumentParser` object that can be modified as usual.
returns an :class:`ArgumentParser` object that can be modified as usual.
Description of parameters:
* title - title for the sub-parser group in help output; by default
"subcommands" if description is provided, otherwise uses title for
positional arguments
* description - description for the sub-parser group in help output, by
default None
* prog - usage information that will be displayed with sub-command help,
by default the name of the program and any positional arguments before the
subparser argument
* parser_class - class which will be used to create sub-parser instances, by
default the class of the current parser (e.g. ArgumentParser)
* dest - name of the attribute under which sub-command name will be
stored; by default None and no value is stored
* help - help for sub-parser group in help output, by default None
* metavar - string presenting available sub-commands in help; by default it
is None and presents sub-commands in form {cmd1, cmd2, ..}
Some example usage::
Some example usage::
>>> # create the top-level parser
>>> # create the top-level parser
...
...
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