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" ),
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"},
QCoreApplication::translate( "main", "Set output filename to <filename>. 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() )
{