/* Copyright 2006-2025 The QElectroTech Team This file is part of QElectroTech. QElectroTech is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. QElectroTech is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with QElectroTech. If not, see . */ #ifndef CLI_EXPORT_H #define CLI_EXPORT_H #include /** @brief Headless command-line export. Implements the long-requested batch/headless export (qelectrotech.org bugtracker #171, GitHub #309): render a project's diagrams to files without opening the GUI. Detected and handled in main() before the GUI is created. */ namespace CLIExport { /** @brief True if @p args request a CLI export (i.e. contain one of the export options). */ bool isExportRequest(const QStringList &args); /** @brief Run the CLI export described by @p args. @return process exit code (0 on success). Usage: qelectrotech --export-pdf qelectrotech --export-png qelectrotech --export-svg qelectrotech --export-cables qelectrotech --export-wires qelectrotech --export-bom qelectrotech --export-nets qelectrotech --export-links qelectrotech --info [output.json] qelectrotech --check-elements qelectrotech --resave PDF: one multi-page document (one diagram per page). PNG/SVG: one file per diagram, named /_.<ext>. cables: wiring list (one row per conductor) as CSV. wires: list of distinct wire numbers as CSV. bom: bill of materials (one row per element) as CSV. nets: electrical nets (connected-terminal groups) as JSON. links: element cross-references (coil/contact) as CSV, with unresolved links flagged. info: structural project summary as JSON (stdout, or a file) — per-page element / conductor counts and unconnected terminals. check-elements: validate .elmt file(s) against the element schema. resave: load and rewrite the project XML (round-trip integrity). */ int run(const QStringList &args); } #endif // CLI_EXPORT_H