diff --git a/glabels-batch/main.cpp b/glabels-batch/main.cpp index ef1cb30..2bfa564 100644 --- a/glabels-batch/main.cpp +++ b/glabels-batch/main.cpp @@ -100,6 +100,11 @@ int main( int argc, char **argv ) QCoreApplication::translate( "main", "printer" ), QPrinterInfo::defaultPrinterName() }, + {{"i","input"}, + QCoreApplication::translate( "main", "Set merge input to (typically a filename). Set to \"-\" for stdin." ), + QCoreApplication::translate( "main", "source" ), + "" }, + {{"o","output"}, QCoreApplication::translate( "main", "Set output filename to . Set to \"-\" for stdout. (Default=\"output.pdf\")" ), QCoreApplication::translate( "main", "filename" ), @@ -221,6 +226,17 @@ int main( int argc, char **argv ) qDebug() << "Batch mode. printer =" << QPrinterInfo::defaultPrinterName(); } + if ( parser.isSet( "input" ) ) + { + QString inputSource = parser.value( "input" ); + if ( inputSource == "-" ) + { + inputSource = STDIN_FILENAME; + } + qDebug() << "Merge source =" << inputSource; + model->merge()->setSource( inputSource ); + } + glabels::model::PageRenderer renderer( model ); if ( model->merge()->keys().empty() ) { diff --git a/user-docs/README.md b/user-docs/README.md new file mode 100644 index 0000000..3e8df1e --- /dev/null +++ b/user-docs/README.md @@ -0,0 +1,6 @@ +Man pages must be rebuilt manually after modifying rst files. Requires sphinx-build installed on system. + +To rebuild from project binary directory: +``` +$ make manpages +``` diff --git a/user-docs/_build/man/glabels-batch-qt.1 b/user-docs/_build/man/glabels-batch-qt.1 index 8eca1e4..177aad6 100644 --- a/user-docs/_build/man/glabels-batch-qt.1 +++ b/user-docs/_build/man/glabels-batch-qt.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "GLABELS-BATCH-QT" "1" "Dec 17, 2025" "" "gLabels" +.TH "GLABELS-BATCH-QT" "1" "Jan 01, 2026" "" "gLabels" .SH NAME glabels-batch-qt \- print glabels project from command line .SH SYNOPSIS @@ -37,7 +37,7 @@ glabels-batch-qt \- print glabels project from command line .sp \fBglabels\-batch\-qt\fP is a utility for printing a glabels project file from the command line. This command takes exactly one project file, FILE. If FILE -is \(dq\-\(dq, it expects an XML glabels project to be provided on standard input. +is "\-", it expects an XML glabels project to be provided on standard input. .SH OPTIONS .INDENT 0.0 .TP @@ -61,11 +61,15 @@ Send output to . .UNINDENT .INDENT 0.0 .TP +.B \-i , \-\-input +Set merge input to (typically a filename). If source is "\-", read from standard input. +This option overrides the merge source specified in the original glabels project file. +.UNINDENT +.INDENT 0.0 +.TP .B \-o [], \-\-output [] -.TP -.B Set output filename to . If filename is \(dq\-\(dq, write to standard output. -.TP -.B (Default=\(dqoutput.pdf\(dq) +Set output filename to . If filename is "\-", write to standard output. +(Default="output.pdf") .UNINDENT .INDENT 0.0 .TP @@ -136,9 +140,11 @@ On GNU/Linux platforms, \fBglabels\-batch\-qt\fP must be run from within a windo .INDENT 0.0 .INDENT 3.5 .sp -.EX +.nf +.ft C xvfb\-run glabels\-batch\-qt \-o output.pdf myProject.glabels -.EE +.ft P +.fi .UNINDENT .UNINDENT .SH REPORTING BUGS diff --git a/user-docs/_build/man/glabels-qt.1 b/user-docs/_build/man/glabels-qt.1 index 4a57098..b2885e8 100644 --- a/user-docs/_build/man/glabels-qt.1 +++ b/user-docs/_build/man/glabels-qt.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "GLABELS-QT" "1" "Dec 17, 2025" "" "gLabels" +.TH "GLABELS-QT" "1" "Jan 01, 2026" "" "gLabels" .SH NAME glabels-qt \- create labels and business cards .SH SYNOPSIS diff --git a/user-docs/man/glabels-batch-qt.rst b/user-docs/man/glabels-batch-qt.rst index db0cc52..2b2ac97 100644 --- a/user-docs/man/glabels-batch-qt.rst +++ b/user-docs/man/glabels-batch-qt.rst @@ -35,7 +35,13 @@ OPTIONS Send output to . +.. option:: -i , --input + + Set merge input to (typically a filename). If source is "-", read from standard input. + This option overrides the merge source specified in the original glabels project file. + .. option:: -o [], --output [] + Set output filename to . If filename is "-", write to standard output. (Default="output.pdf")