Graham Percival wrote:
What about a version that read from standard input and wrote to
standard input? I'm thinking about the documentation -- we could
automatically format all lilypond input syntax.
On unix a lot of tools default to input coming from one or more file(s)
whose names are specified on the command line, and output going to
standard output. They act as filters and you can put them in
pipelines. Some specify one or more input filename(s) as the only
non-option command line argument(s). Many of them have no facility to
specify output filenames, requiring redirection if you want them to
write to a file. Examples include sed, od, hd, col, cut, awk, indent,
and bc. One variant you see a lot is that some programs will read a
file list and after they're done they'll read from stdin until they run
out of input.
indent, which does for C programs what you're doing for lilypond
programs has several syntaxes.
indent [options] [input-files]
This will create a backup of all the input files and then replace
the original file with prettyfied versions.
indent [options] [-o output-file]
If no files are specified, it reads from standard in and then if
there's no -o option it writes to standard out. If there is a -o option
it writes to the specified file.
indent [options] [single-input-file] [-o output-file]
This will write to the output file if -o specified, backup and
replace the original single-input-file if -o not specified.
indent -st [input-file]
the -st option means write to standard out, so writes the result of
prettyfying the input-file to standard out.
Hope this helps.
Patrick
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user