Rules for Command-Line Syntax

Started by sukishan, Jul 14, 2009, 03:58 PM

Previous topic - Next topic

sukishan

Rules for Command-Line Syntax

The Visual J# compiler code uses the following rules when interpreting arguments given on the operating system (OS) command line:

* Arguments are delimited by white space, which is either a space or a tab.

* The caret character (^) is not recognized as an escape character or delimiter. The character is handled completely by the command-line parser in the OS before being passed to the argv array in the program.

* A string surrounded by double quotation marks ("string") is interpreted as a single argument, regardless of white space contained within. A quoted string can be embedded in an argument.

* A double-quotation mark preceded by a backslash (\") is interpreted as a literal double-quotation mark character (").

* Backslashes are interpreted literally, unless they immediately precede a double-quotation mark.

* If an even number of backslashes is followed by a double-quotation mark, one backslash is placed in the argv array for every pair of backslashes, and the double-quotation mark is interpreted as a string delimiter.

* If an odd number of backslashes is followed by a double-quotation mark, one backslash is placed in the argv array for every pair of backslashes, and the double-quotation mark is escaped by the remaining backslash, causing a literal double-quotation mark (") to be placed in argv.
A good beginning makes a good ending