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
10f047dc
Kaydet (Commit)
10f047dc
authored
Ock 19, 2012
tarafından
Sandro Tosi
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #13605: add documentation for nargs=argparse.REMAINDER
üst
d53abd31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
argparse.rst
Doc/library/argparse.rst
+11
-0
No files found.
Doc/library/argparse.rst
Dosyayı görüntüle @
10f047dc
...
@@ -838,6 +838,17 @@ values are:
...
@@ -838,6 +838,17 @@ values are:
usage: PROG [-h] foo [foo ...]
usage: PROG [-h] foo [foo ...]
PROG: error: too few arguments
PROG: error: too few arguments
* ``argparse.REMAINDER``. All the remaining command-line arguments
are gathered into a lits. This is commonly useful for command line
utilities that dispatch to other command line utilities.
>>> parser = argparse.ArgumentParser(prog='PROG')
>>> parser.add_argument('--foo')
>>> parser.add_argument('command')
>>> parser.add_argument('args', nargs=argparse.REMAINDER)
>>> print parser.parse_args('--foo B XX YY ZZ'.split())
Namespace(args=['YY', 'ZZ'], command='XX', foo='B')
If the ``nargs`` keyword argument is not provided, the number of arguments consumed
If the ``nargs`` keyword argument is not provided, the number of arguments consumed
is determined by the action_. Generally this means a single command-line argument
is determined by the action_. Generally this means a single command-line argument
will be consumed and a single item (not a list) will be produced.
will be consumed and a single item (not a list) will be produced.
...
...
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