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 schematic file to KiCad format" ) ) );
43 .default_value( std::string(
"auto" ) )
44 .help(
UTF8STDSTR(
_(
"Input format hint: auto, altium, eagle, cadstar, easyeda, "
45 "easyedapro, ltspice, pads, diptrace (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_SCH_IMPORT> importJob = std::make_unique<JOB_SCH_IMPORT>();
69 if( format == wxS(
"auto" ) )
71 else if( format == wxS(
"altium" ) )
73 else if( format == wxS(
"eagle" ) )
75 else if( format == wxS(
"cadstar" ) )
77 else if( format == wxS(
"easyeda" ) )
79 else if( format == wxS(
"easyedapro" ) )
81 else if( format == wxS(
"ltspice" ) )
83 else if( format == wxS(
"pads" ) )
85 else if( format == wxS(
"diptrace" ) )
89 wxFprintf( stderr,
_(
"Invalid format: %s\n" ), format );
97 wxFprintf( stderr,
_(
"Invalid report format: %s\n" ), reportFormat );
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
bool ParseImportReportFormat(const wxString &aText, IMPORT_REPORT_FORMAT &aFormat)
Parse the user-facing report format name ("none", "json" or "text") into its enum.
This file contains miscellaneous commonly used macros and functions.
static const int ERR_ARGS
static const int ERR_INVALID_INPUT_FILE
static const int ERR_UNKNOWN_FILE_FORMAT
No plugin for the requested face recognized the input file format.
wxString From_UTF8(const char *cstring)