26#include <wx/filename.h>
28#define ARG_TARGET "--target"
29#define ARG_FORCE "--force"
30#define ARG_DRY_RUN "--dry-run"
31#define ARG_LIBRARIES "--libraries"
32#define ARG_VARIANT "--variant"
33#define ARG_DROP_APPROXIMATIONS "--drop-approximations"
39 m_argParser.add_description(
UTF8STDSTR(
_(
"Export a copy of the board readable by an older KiCad version" ) ) );
42 .default_value( std::string() )
44 _(
"Target version name or id, e.g. \"KiCad 10.0\" or \"10.0\". Defaults to the newest." ) ) );
47 .help(
UTF8STDSTR(
_(
"Export even if some features must be dropped or approximated" ) ) )
51 .help(
UTF8STDSTR(
_(
"Print the compatibility report without writing anything" ) ) )
56 _(
"Omit features instead of approximating them; may remove drawing or electrical data" ) ) )
60 .default_value( std::string() )
61 .help(
UTF8STDSTR(
_(
"Copy this library folder beside the output board and downgrade its footprints" ) ) );
64 .default_value( std::string() )
65 .help(
UTF8STDSTR(
_(
"Flatten this variant into the export. Default is the base design." ) ) );
70 std::unique_ptr<JOB_PCB_DOWNGRADE> job = std::make_unique<JOB_PCB_DOWNGRADE>();
81 if( !wxFile::Exists( job->m_filename ) )
83 wxFprintf( stderr,
_(
"Board file does not exist or is not accessible\n" ) );
90 if( job->m_outputFile.IsEmpty() )
92 wxFprintf( stderr,
_(
"An output file is required. Use --output.\n" ) );
100 wxFprintf( stderr, wxT(
"%s\n" ), error );
argparse::ArgumentParser m_argParser
COMMAND(const std::string &aName)
Define a new COMMAND instance.
void addCommonArgs(bool aInput, bool aOutput, IO_TYPE aInputType, IO_TYPE aOutputType)
Set up the most common of args used across cli.
wxString m_argOutput
Value of the output arg if configured.
wxString m_argInput
Value of the common input arg if configured.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
int ProcessJob(KIWAY::FACE_T aFace, JOB *aJob, REPORTER *aReporter=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
#define ARG_DROP_APPROXIMATIONS
bool ValidateFreshDowngradeOutput(const wxString &aOutput, wxString &aError)
static const int ERR_ARGS
static const int ERR_INVALID_INPUT_FILE
int doPerform(KIWAY &aKiway) override
The internal handler that should be overloaded to implement command specific processing and work.