View Issue Details

IDProjectCategoryView StatusLast Update
00001591003.1(2008)/Issue 7Shell and Utilitiespublic2013-04-16 13:06
Reporternick Assigned Toajosey  
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameNick Stoughton
OrganizationUSENIX
User Referencejmg-getopts-001
Sectiongetopts
Page Number2778
Line Number90589
Interp Status---
Final Accepted TextSee 0000159:0000244
Summary0000159: Wording improvement for getopts
DescriptionDouble negatives are hard to parse ...
Desired ActionChange

if there are no other non-option-arguments appearing before it

to

if there are only option arguments appearing before it
Tagstc1-2008

Activities

geoffclare

2009-09-28 16:46

manager   bugnote:0000244

That whole paragraph has more problems. Firstly, the phrase
"non-option-argument" is ambiguous: it can be parsed as
(non-option)-argument as intended, or as non-(option-argument).
Secondly, it doesn't properly account for arguments that are
option-arguments. Thirdly, it uses "option-argument" when it
means an argument that is an option. Finally, it refers to "--"
as a "special option", which it is not.

I think the most awkward complications could be avoided simply
by referring to operands.

Here is a suggested replacement paragraph:

    When the end of options is encountered, the getopts utility shall
    exit with a return value greater than zero; the shell variable
    OPTIND shall be set to the index of the first operand, or the
    value "$#"+1 if there are no operands; the name variable shall be
    set to the <question-mark> character. Any of the following
    shall identify the end of options: the first "--" argument that
    is not an option-argument, finding an argument that is not an
    option-argument and does not begin with a '-', or encountering
    an error.

Issue History

Date Modified Username Field Change
2009-09-28 16:00 nick New Issue
2009-09-28 16:00 nick Status New => Under Review
2009-09-28 16:00 nick Assigned To => ajosey
2009-09-28 16:00 nick Name => Nick Stoughton
2009-09-28 16:00 nick Organization => USENIX
2009-09-28 16:00 nick User Reference => jmg-getopts-001
2009-09-28 16:00 nick Section => getopts
2009-09-28 16:00 nick Page Number => 2778
2009-09-28 16:00 nick Line Number => 90589
2009-09-28 16:00 nick Interp Status => ---
2009-09-28 16:46 geoffclare Note Added: 0000244
2009-10-08 16:10 nick Final Accepted Text => See 0000159:0000244
2009-10-08 16:10 nick Status Under Review => Resolved
2009-10-08 16:10 nick Resolution Open => Accepted As Marked
2010-08-27 13:08 ajosey Tag Attached: tc1-2008
2013-04-16 13:06 ajosey Status Resolved => Closed