Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 87621 - Handling option errors (bug or feature?)
Summary: Handling option errors (bug or feature?)
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: popt
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
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:
Always

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.