Skip to content

Commit da23e72

Browse files
committed
Updated readme and incremented version to 1.2.0.
1 parent 8f0073b commit da23e72

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ located [here](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap1
7171

7272
Each argument is treated as a key-value pair, regardless of whether a value is present. The general format is as follows:
7373

74-
```<-|--|/>argument-name<=|:| >["|']value['|"] [operand] ... [operand]```
74+
```<-|--|/>argument-name<=|:| >["|']value['|"] [--] [operand] ... [operand]```
7575

7676
The key-value pair may begin with a single dash, a pair of dashes (double dash), or a forward slash. Single and double dashes indicate the use of short
7777
or long names, respectively, which are covered below. The forward slash may represent either, but does not allow for the grouping of parameterless
@@ -86,6 +86,9 @@ Values may be any alphanumeric sequence, however if a value contains a space it
8686
Any word, or phrase enclosed in single or double quotes, will be parsed as an operand. The official specification requires operands to appear last, however this library will
8787
parse them in any position.
8888

89+
A double-hyphen ```--```, not enclosed in single or double quotes, and appearing with whitespace on either side, designates the end of the argument list and beginning of
90+
the operand list. Anything appearing after this delimiter is treated as an operand, even if it begins with a hyphen, double-hyphen or forward slash.
91+
8992
### Short Names
9093

9194
Short names consist of a single character, and arguments without parameters may be grouped. A grouping may be terminated with a single argument containing
@@ -158,11 +161,12 @@ new | slashes are ok too
158161

159162
### Operands
160163

161-
Any text in the string that doesn't match the argument-value format is considered an operand.
164+
Any text in the string that doesn't match the argument-value format is considered an operand. Any text which appears after a double-hyphen ```--```, not enclosed in single or double quotes, and with spaces on either side,
165+
is treated as an operand regardless of whether it matches the argument-value format.
162166

163167
#### Example
164168

165-
```-a foo bar "hello world" -b```
169+
```-a foo bar "hello world" -b -- -explicit operand```
166170

167171
Key | Value
168172
--- | ---
@@ -172,6 +176,8 @@ b |
172176
Operands
173177
1. bar
174178
2. "hello world"
179+
3. -explicit
180+
4. operand
175181

176182
## Parsing
177183

Utility.CommandLine.Arguments/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
[assembly: AssemblyCulture("")]
1212
[assembly: ComVisible(false)]
1313
[assembly: Guid("b739dd22-4bd3-4d17-a351-33d129e9fe30")]
14-
[assembly: AssemblyVersion("1.1.2")]
15-
[assembly: AssemblyFileVersion("1.1.2")]
14+
[assembly: AssemblyVersion("1.2.0")]
15+
[assembly: AssemblyFileVersion("1.2.0")]

0 commit comments

Comments
 (0)