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"
46 m_argParser.add_description(
UTF8STDSTR(
_(
"Runs the Design Rules Check (DRC) on the PCB and creates a report" ) ) );
49 .default_value( std::string(
"report" ) )
50 .help(
UTF8STDSTR(
_(
"Output file format, options: json, report" ) ) )
54 .help(
UTF8STDSTR(
_(
"Report all errors for each track" ) ) )
55 .implicit_value(
true )
56 .default_value(
false );
59 .default_value( std::string(
"mm" ) )
60 .help(
UTF8STDSTR(
_(
"Report units; valid options: in, mm, mils" ) ) )
64 .help(
UTF8STDSTR(
_(
"Report all DRC violations, this is equivalent to including all the other severity arguments" ) ) )
65 .implicit_value(
true )
66 .default_value(
false );
69 .help(
UTF8STDSTR(
_(
"Report all DRC error level violations, this can be combined with the other severity arguments" ) ) )
70 .implicit_value(
true )
71 .default_value(
false );
74 .help(
UTF8STDSTR(
_(
"Report all DRC warning level violations, this can be combined with the other severity arguments" ) ) )
75 .implicit_value(
true )
76 .default_value(
false );
79 .help(
UTF8STDSTR(
_(
"Report all excluded DRC violations, this can be combined with the other severity arguments" ) ) )
80 .implicit_value(
true )
81 .default_value(
false );
84 .help(
UTF8STDSTR(
_(
"Return a exit code depending on whether or not violations exist" ) ) )
85 .implicit_value(
true )
86 .default_value(
false );
92 std::unique_ptr<JOB_PCB_DRC> drcJob(
new JOB_PCB_DRC(
true ) );
94 drcJob->m_outputFile = m_argOutput;
95 drcJob->m_filename = m_argInput;
96 drcJob->SetVarOverrides( m_argDefineVars );
124 if( units == wxS(
"mm" ) )
128 else if( units == wxS(
"in" ) )
132 else if( units == wxS(
"mils" ) )
136 else if( !units.IsEmpty() )
138 wxFprintf( stderr,
_(
"Invalid units specified\n" ) );
143 if( format ==
"report" )
147 else if( format ==
"json" )
153 wxFprintf( stderr,
_(
"Invalid report format\n" ) );
argparse::ArgumentParser m_argParser
void addDefineArg()
Sets up the drawing sheet arg used by many of the export commands.
void addCommonArgs(bool aInput, bool aOutput, bool aInputIsDir, bool aOutputIsDir)
Sets 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 *job)
#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)