Bug 87621 - Handling option errors (bug or feature?)
Summary: Handling option errors (bug or feature?)
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: popt
Version: 8.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2003-03-31 04:46 UTC by Marcus Harnisch
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-04-03 16:03:42 UTC

Attachments (Terms of Use)

Description Marcus Harnisch 2003-03-31 04:46:29 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.8 (X11; Linux i686; U;) Gecko/20021208

Description of problem:
When a multi-character option string contains at least one unknown
option, the entire option string (including valid options) is returned
by poptBadOption().

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Write a tool using the basic option parsing loop.

Actual Results:  Example (again, using my [not so] imaginary tool getpopt)
$ ./getpopt -of -- -bar
getpopt: unknown option '-bar'
$ ./getpopt -of -- -foo
getpopt: unknown option '-foo'
-f -- 

Expected Results:  $ ./getpopt -of -- -bar
getpopt: unknown option '-b'
getpopt: unknown option '-a'
getpopt: unknown option '-r'
$ ./getpopt -of -- -foo
getpopt: unknown option '-o'
getpopt: unknown option '-o'
-f -- 

Additional info:

Comment 1 Jeff Johnson 2003-04-03 16:03:42 UTC
I call these featlets or bugtures depending on mood ;-)

Yes, I can see that there is potential for confusion
when displaying the output of poptBadOption, but the current
behavior of returning the entire token isn't too bad; Think
of the behavior as displaying additional contextual info.

Deferred for contemplation when I next make a pass through popt code.

Note You need to log in before you can comment on or make changes to this bug.