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"
48 "and creates a report" ) ) );
51 .default_value( std::string(
"report" ) )
52 .help(
UTF8STDSTR(
_(
"Output file format, options: json, report" ) ) )
56 .help(
UTF8STDSTR(
_(
"Report all errors for each track" ) ) )
60 .help(
UTF8STDSTR(
_(
"Test for parity between PCB and schematic" ) ) )
64 .default_value( std::string(
"mm" ) )
65 .help(
UTF8STDSTR(
_(
"Report units; valid options: in, mm, mils" ) ) )
69 .help(
UTF8STDSTR(
_(
"Report all DRC violations, this is equivalent to including "
70 "all the other severity arguments" ) ) )
74 .help(
UTF8STDSTR(
_(
"Report all DRC error level violations, this can be combined "
75 "with the other severity arguments" ) ) )
79 .help(
UTF8STDSTR(
_(
"Report all DRC warning level violations, this can be combined "
80 "with the other severity arguments" ) ) )
84 .help(
UTF8STDSTR(
_(
"Report all excluded DRC violations, this can be combined with "
85 "the other severity arguments" ) ) )
89 .help(
UTF8STDSTR(
_(
"Return a nonzero exit code if DRC violations exist" ) ) )
96 std::unique_ptr<JOB_PCB_DRC> drcJob(
new JOB_PCB_DRC() );
98 drcJob->m_outputFile = m_argOutput;
99 drcJob->m_filename = m_argInput;
100 drcJob->SetVarOverrides( m_argDefineVars );
126 drcJob->m_severity = severity;
132 if( units == wxS(
"mm" ) )
136 else if( units == wxS(
"in" ) )
140 else if( units == wxS(
"mils" ) )
144 else if( !units.IsEmpty() )
146 wxFprintf( stderr,
_(
"Invalid units specified\n" ) );
151 if( format ==
"report" )
155 else if( format ==
"json" )
161 wxFprintf( stderr,
_(
"Invalid report format\n" ) );
165 drcJob->m_parity = m_argParser.get<
bool>(
ARG_PARITY );
argparse::ArgumentParser m_argParser
void addDefineArg()
Set up the drawing sheet arg used by many of the export commands.
void addCommonArgs(bool aInput, bool aOutput, bool aInputIsDir, bool aOutputIsDir)
Set up the most common of args used across cli.
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)
#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)