Issue 4641: optparse - dosn't distinguish between '--option' and '-option'

Issue4641

Created on 2008-12-12 14:15 by kszawala, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg77669 - (view) Author: Krzysztof Szawala (kszawala) Date: 2008-12-12 14:15
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.
msg77680 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-12-12 17:29
Duplicate of issue #4640.
History
Date User Action Args
2022-04-11 14:56:42adminsetgithub: 48891
2008-12-12 17:29:40mark.dickinsonsetstatus: open -> closed
resolution: duplicate
messages: + msg77680
nosy: + mark.dickinson
2008-12-12 14:15:17kszawalacreate