30#include <wx/tokenzr.h>
32#define ARG_FORMAT "--format"
33#define ARG_ALL_TRACK_ERRORS "--all-track-errors"
34#define ARG_UNITS "--units"
35#define ARG_SEVERITY_ALL "--severity-all"
36#define ARG_SEVERITY_ERROR "--severity-error"
37#define ARG_SEVERITY_WARNING "--severity-warning"
38#define ARG_SEVERITY_EXCLUSIONS "--severity-exclusions"
39#define ARG_EXIT_CODE_VIOLATIONS "--exit-code-violations"
40#define ARG_PARITY "--schematic-parity"
41#define ARG_ZONE_FILL "--refill-zones"
42#define ARG_SAVE_BOARD "--save-board"
50 "and creates a report" ) ) );
53 .default_value( std::string(
"report" ) )
54 .help(
UTF8STDSTR(
_(
"Output file format, options: json, report" ) ) )
58 .help(
UTF8STDSTR(
_(
"Report all errors for each track" ) ) )
62 .help(
UTF8STDSTR(
_(
"Test for parity between PCB and schematic" ) ) )
66 .default_value( std::string(
"mm" ) )
67 .help(
UTF8STDSTR(
_(
"Report units; valid options: in, mm, mils" ) ) )
71 .help(
UTF8STDSTR(
_(
"Report all DRC violations, this is equivalent to including "
72 "all the other severity arguments" ) ) )
76 .help(
UTF8STDSTR(
_(
"Report all DRC error level violations, this can be combined "
77 "with the other severity arguments" ) ) )
81 .help(
UTF8STDSTR(
_(
"Report all DRC warning level violations, this can be combined "
82 "with the other severity arguments" ) ) )
86 .help(
UTF8STDSTR(
_(
"Report all excluded DRC violations, this can be combined with "
87 "the other severity arguments" ) ) )
91 .help(
UTF8STDSTR(
_(
"Return a nonzero exit code if DRC violations exist" ) ) )
95 .help(
UTF8STDSTR(
_(
"Refill zones before running DRC" ) ) )
99 .help(
UTF8STDSTR(
_(
"Save the board after DRC, must be used with --refill-zones" ) ) )
106 std::unique_ptr<JOB_PCB_DRC> drcJob(
new JOB_PCB_DRC() );
108 drcJob->SetConfiguredOutputPath( m_argOutput );
109 drcJob->m_filename = m_argInput;
110 drcJob->SetVarOverrides( m_argDefineVars );
136 drcJob->m_severity = severity;
142 if( units == wxS(
"mm" ) )
146 else if( units == wxS(
"in" ) )
150 else if( units == wxS(
"mils" ) )
154 else if( !units.IsEmpty() )
156 wxFprintf( stderr,
_(
"Invalid units specified\n" ) );
161 if( format ==
"report" )
165 else if( format ==
"json" )
171 wxFprintf( stderr,
_(
"Invalid report format\n" ) );
175 drcJob->m_parity = m_argParser.get<
bool>(
ARG_PARITY );
176 drcJob->m_refillZones = m_argParser.get<
bool>(
ARG_ZONE_FILL );
void addCommonArgs(bool aInput, bool aOutput, bool aInputCanBeDir, bool aOutputIsDir)
Set up the most common of args used across cli.
argparse::ArgumentParser m_argParser
void addDefineArg()
Set up the drawing sheet arg used by many of the export commands.
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_SEVERITY_EXCLUSIONS
#define ARG_ALL_TRACK_ERRORS
#define ARG_SEVERITY_ERROR
#define ARG_SEVERITY_WARNING
#define ARG_EXIT_CODE_VIOLATIONS
This file contains miscellaneous commonly used macros and functions.
static const int ERR_ARGS
wxString From_UTF8(const char *cstring)