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
7842a41f
Kaydet (Commit)
7842a41f
authored
Eyl 17, 2009
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove duplicate doc of enable/disable_interspersed_args.
üst
304d3966
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
27 deletions
+19
-27
optparse.rst
Doc/library/optparse.rst
+19
-27
No files found.
Doc/library/optparse.rst
Dosyayı görüntüle @
7842a41f
...
...
@@ -1207,18 +1207,27 @@ and you can also poke around your option parser and see what's there.
OptionParser provides several methods to help you out:
``disable_interspersed_args()``
Set parsing to stop on the first non-option. Use this if you have a
command processor which runs another command which has options of
its own and you want to make sure these options don't get
confused. For example, each command might have a different
set of options.
Set parsing to stop on the first non-option. For example, if ``"-a"`` and
``"-b"`` are both simple options that take no arguments, :mod:`optparse`
normally accepts this syntax::
prog -a arg1 -b arg2
and treats it as equivalent to ::
prog -a -b arg1 arg2
To disable this feature, call ``disable_interspersed_args()``. This restores
traditional Unix syntax, where option parsing stops with the first non-option
argument.
Use this if you have a command processor which runs another command which has
options of its own and you want to make sure these options don't get confused.
For example, each command might have a different set of options.
``enable_interspersed_args()``
Set parsing to not stop on the first non-option, allowing
interspersing switches with command arguments. For example,
``"-s arg1 --long arg2"`` would return ``["arg1", "arg2"]``
as the command arguments and ``-s, --long`` as options.
This is the default behavior.
Set parsing to not stop on the first non-option, allowing interspersing
switches with command arguments. This is the default behavior.
``get_option(opt_str)``
Returns the Option instance with the option string ``opt_str``, or ``None`` if
...
...
@@ -1329,23 +1338,6 @@ OptionParser supports several other public methods:
constructor keyword argument. Passing ``None`` sets the default usage string;
use ``SUPPRESS_USAGE`` to suppress a usage message.
* ``enable_interspersed_args()``, ``disable_interspersed_args()``
Enable/disable positional arguments interspersed with options, similar to GNU
getopt (enabled by default). For example, if ``"-a"`` and ``"-b"`` are both
simple options that take no arguments, :mod:`optparse` normally accepts this
syntax::
prog -a arg1 -b arg2
and treats it as equivalent to ::
prog -a -b arg1 arg2
To disable this feature, call ``disable_interspersed_args()``. This restores
traditional Unix syntax, where option parsing stops with the first non-option
argument.
* ``set_defaults(dest=value, ...)``
Set default values for several option destinations at once. Using
...
...
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