Bug 87621

Summary: Handling option errors (bug or feature?)
Product: [Retired] Red Hat Linux Reporter: Marcus Harnisch <marcus.harnisch>
Component: poptAssignee: Jeff Johnson <jbj>
Status: CLOSED DEFERRED QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-04-03 16:03:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.