Add merge input option to glabels-batch-qt. (#267,#274)

This commit is contained in:
Jaye Evins
2026-01-01 19:51:38 -05:00
committed by GitHub
parent 3309837080
commit d17bb2e1be
5 changed files with 43 additions and 9 deletions
+16
View File
@@ -100,6 +100,11 @@ int main( int argc, char **argv )
QCoreApplication::translate( "main", "printer" ), QCoreApplication::translate( "main", "printer" ),
QPrinterInfo::defaultPrinterName() }, QPrinterInfo::defaultPrinterName() },
{{"i","input"},
QCoreApplication::translate( "main", "Set merge input to <source> (typically a filename). Set to \"-\" for stdin." ),
QCoreApplication::translate( "main", "source" ),
"" },
{{"o","output"}, {{"o","output"},
QCoreApplication::translate( "main", "Set output filename to <filename>. Set to \"-\" for stdout. (Default=\"output.pdf\")" ), QCoreApplication::translate( "main", "Set output filename to <filename>. Set to \"-\" for stdout. (Default=\"output.pdf\")" ),
QCoreApplication::translate( "main", "filename" ), QCoreApplication::translate( "main", "filename" ),
@@ -221,6 +226,17 @@ int main( int argc, char **argv )
qDebug() << "Batch mode. printer =" << QPrinterInfo::defaultPrinterName(); 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 ); glabels::model::PageRenderer renderer( model );
if ( model->merge()->keys().empty() ) if ( model->merge()->keys().empty() )
{ {
+6
View File
@@ -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
```
+14 -8
View File
@@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u .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 .SH NAME
glabels-batch-qt \- print glabels project from command line glabels-batch-qt \- print glabels project from command line
.SH SYNOPSIS .SH SYNOPSIS
@@ -37,7 +37,7 @@ glabels-batch-qt \- print glabels project from command line
.sp .sp
\fBglabels\-batch\-qt\fP is a utility for printing a glabels project file \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 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 .SH OPTIONS
.INDENT 0.0 .INDENT 0.0
.TP .TP
@@ -61,11 +61,15 @@ Send output to <printer>.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-i <source>, \-\-input <source>
Set merge input to <source> (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 [<filename>], \-\-output [<filename>] .B \-o [<filename>], \-\-output [<filename>]
.TP Set output filename to <filename>. If filename is "\-", write to standard output.
.B Set output filename to <filename>. If filename is \(dq\-\(dq, write to standard output. (Default="output.pdf")
.TP
.B (Default=\(dqoutput.pdf\(dq)
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@@ -136,9 +140,11 @@ On GNU/Linux platforms, \fBglabels\-batch\-qt\fP must be run from within a windo
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
.sp .sp
.EX .nf
.ft C
xvfb\-run glabels\-batch\-qt \-o output.pdf myProject.glabels xvfb\-run glabels\-batch\-qt \-o output.pdf myProject.glabels
.EE .ft P
.fi
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.SH REPORTING BUGS .SH REPORTING BUGS
+1 -1
View File
@@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u .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 .SH NAME
glabels-qt \- create labels and business cards glabels-qt \- create labels and business cards
.SH SYNOPSIS .SH SYNOPSIS
+6
View File
@@ -35,7 +35,13 @@ OPTIONS
Send output to <printer>. Send output to <printer>.
.. option:: -i <source>, --input <source>
Set merge input to <source> (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 [<filename>], --output [<filename>] .. option:: -o [<filename>], --output [<filename>]
Set output filename to <filename>. If filename is "-", write to standard output. Set output filename to <filename>. If filename is "-", write to standard output.
(Default="output.pdf") (Default="output.pdf")