On 05/10/2011 11:49 PM, Tommaso Cucinotta wrote:
Independently of how it can be implemented, this is a possible
re-thinking of the syntax (by examples):

lyx myfile.txt # import from TXT
lyx -i latex myfile.txt # explicitly specify the import format
lyx -o dest.txt source.lyx # export from LYX to TXT
lyx -e latex -o dest.txt source.lyx # export to LATEX, output to dest.txt
lyx -e latex source.lyx # export to LATEX, output to source.tex
lyx -e latex -o /path/to/dest.tex source.lyx # Got the point
lyx -c source.svg -o dest.eps # convert arbitrary formats
(extension-based format detection for output)
lyx -c -i svg source.svg -e eps -o dest.eps # explicitly set the input
and output formats

Summarising, a few options would be common to import/export of document
or image formats:

-i fmt specify input/import format
-e fmt specify export format
-o filename specify output filename

If "-e" or "-o" is specified, then assume/imply "--batch" and attempt an
export. If "-c" is present, try to act as batch converter.


IMHO that would be a quite nice and natural way to use LyX from the command line.

Also, I'd like to see a help message in response to "lyx -h" or
"--help", the "userdir", "sysdir", "batch" and "version" options should
be prefixed by a double dash "--userdir", "--sysdir", "--batch",
"--version" plus perhaps having an equivalent shorter option (-u, -s,
-b, -v).


Sure, that's more gnu-like. We'll have to keep the one-dash versions around, though.

Cheers,
Julien

Reply via email to