27#include <wx/filename.h>
30#define ARG_FORMAT "--format"
31#define ARG_REPORT_FORMAT "--report-format"
32#define ARG_REPORT_FILE "--report-file"
40 UTF8STDSTR(
_(
"Import a non-KiCad PCB file to KiCad format" ) ) );
43 .default_value( std::string(
"auto" ) )
44 .help(
UTF8STDSTR(
_(
"Input format hint: auto, pads, altium, eagle, cadstar, "
45 "fabmaster, pcad, solidworks (default: auto)" ) ) )
49 .default_value( std::string(
"none" ) )
50 .help(
UTF8STDSTR(
_(
"Import report format: none, json, text (default: none)" ) ) )
54 .default_value( std::string(
"" ) )
55 .help(
UTF8STDSTR(
_(
"File path for import report (default: stdout)" ) ) )
62 std::unique_ptr<JOB_PCB_IMPORT> importJob = std::make_unique<JOB_PCB_IMPORT>();
69 if( format == wxS(
"auto" ) )
73 else if( format == wxS(
"pads" ) )
77 else if( format == wxS(
"altium" ) )
81 else if( format == wxS(
"eagle" ) )
85 else if( format == wxS(
"cadstar" ) )
89 else if( format == wxS(
"fabmaster" ) )
93 else if( format == wxS(
"pcad" ) )
97 else if( format == wxS(
"solidworks" ) )
103 wxFprintf( stderr,
_(
"Invalid format: %s\n" ), format );
109 if( reportFormat == wxS(
"none" ) )
113 else if( reportFormat == wxS(
"json" ) )
117 else if( reportFormat == wxS(
"text" ) )
123 wxFprintf( stderr,
_(
"Invalid report format: %s\n" ), reportFormat );
128 importJob->m_reportFile = reportFile;
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.
int doPerform(KIWAY &aKiway) override
The internal handler that should be overloaded to implement command specific processing and work.
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_REPORT_FORMAT
This file contains miscellaneous commonly used macros and functions.
static const int ERR_ARGS
wxString From_UTF8(const char *cstring)