[New-bugs-announce] [issue4642] optparse - dosn't distinguish between '--option' and '-option'

Krzysztof Szawala report at bugs.python.org
Fri Dec 12 15:16:44 CET 2008

New submission from Krzysztof Szawala <kszawala at slb.com>:

I am using optparse for command-line parameters parsing. To follow 
common naming convention I defined -d (minus followed by a single 
character option) and --debug (double minus followed by a word).

It looks like optparse doesn't complain when -debug (single minus) is 
specified and morover it doesn't recognize it as --debug.

I am using Python 2.5.2. Problem was observed on Linux but also occurs 
on Windows.

components: Extension Modules
messages: 77670
nosy: kszawala
severity: normal
status: open
title: optparse - dosn't distinguish between '--option' and '-option'
type: behavior
versions: Python 2.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list