Skip to content

Commit

Permalink
doc fixes for clarity on how input is read
Browse files Browse the repository at this point in the history
  • Loading branch information
sitaramc committed Dec 20, 2012
1 parent 451c468 commit 1a746f5
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions doc/tsh.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,30 @@ I assume you have read the [examples][ex] already.

### syntax

Input is one or more lines.
Input is one or more lines of text, obtained as follows:

* no arguments: STDIN is the input
* exactly one argument which is a readable filename: its contents are the input
* otherwise: the arguments themselves are the input
* if an argument is multi-line, it is split at newlines
* this is what you saw in the [examples][ex] section
* if there are no arguments, use STDIN
* if there is exactly one argument *and* it is a readable filename, use its
contents
* otherwise use the argument list, treating each argument as if it started
on a new line

Comments are allowed but not in the middle of a line (i.e., the whole line
needs to be a comment). Leading whitespace is always thrown away, but not
elsewhere. There are no continuation lines or include files.
This input is separated into tsh commands by

* unescaped semicolons
* newlines

Each line is one or more commands, separated by unescaped semicolons.
(Side effect: this means newlines can be embedded within an argument also if
you find that more convenient, as you can see in several [examples][ex]).

The only way to escape a semicolon is to precede it with a backslash. Any
quotes are taken literally so don't try to use those to escape semicolons.
`TSH_VERBOSE=3` (or higher) will show the commands actually being run.

Comments are allowed but not in the middle of a line (i.e., the whole line
needs to be a comment). Leading whitespace is always thrown away, but not
elsewhere. There are no continuation lines or include files.

### hashhash comments (testnames)

Comment lines that start with optional whitespace, then `##` (two hash marks)
Expand Down

0 comments on commit 1a746f5

Please sign in to comment.