View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000159 | 1003.1(2008)/Issue 7 | Shell and Utilities | public | 2009-09-28 16:00 | 2013-04-16 13:06 |
| Reporter | nick | Assigned To | ajosey | ||
| Priority | normal | Severity | Editorial | Type | Clarification Requested |
| Status | Closed | Resolution | Accepted As Marked | ||
| Name | Nick Stoughton | ||||
| Organization | USENIX | ||||
| User Reference | jmg-getopts-001 | ||||
| Section | getopts | ||||
| Page Number | 2778 | ||||
| Line Number | 90589 | ||||
| Interp Status | --- | ||||
| Final Accepted Text | See 0000159:0000244 | ||||
| Summary | 0000159: Wording improvement for getopts | ||||
| Description | Double negatives are hard to parse ... | ||||
| Desired Action | Change if there are no other non-option-arguments appearing before it to if there are only option arguments appearing before it | ||||
| Tags | tc1-2008 | ||||
|
|
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. |
| 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 |