30#include <wx/tokenzr.h>
32#define ARG_FORMAT "--format"
33#define ARG_UNITS "--units"
34#define ARG_SEVERITY_ALL "--severity-all"
35#define ARG_SEVERITY_ERROR "--severity-error"
36#define ARG_SEVERITY_WARNING "--severity-warning"
37#define ARG_SEVERITY_EXCLUSIONS "--severity-exclusions"
38#define ARG_EXIT_CODE_VIOLATIONS "--exit-code-violations"
46 "schematic and creates a report" ) ) );
49 .default_value( std::string(
"report" ) )
50 .help(
UTF8STDSTR(
_(
"Output file format, options: json, report" ) ) );
53 .default_value( std::string(
"mm" ) )
55 _(
"Report units; valid options: in, mm, mils" ) ) );
58 .help(
UTF8STDSTR(
_(
"Report all ERC violations, this is equivalent to including "
59 "all the other severity arguments" ) ) )
63 .help(
UTF8STDSTR(
_(
"Report all ERC error level violations, this can be combined "
64 "with the other severity arguments" ) ) )
68 .help(
UTF8STDSTR(
_(
"Report all ERC warning level violations, this can be combined "
69 "with the other severity arguments" ) ) )
70 .implicit_value(
true )
71 .default_value(
false );
74 .help(
UTF8STDSTR(
_(
"Report all excluded ERC violations, this can be combined "
75 "with the other severity arguments" ) ) )
79 .help(
UTF8STDSTR(
_(
"Return a nonzero exit code if ERC violations exist" ) ) )
86 std::unique_ptr<JOB_SCH_ERC> ercJob(
new JOB_SCH_ERC() );
88 ercJob->SetConfiguredOutputPath( m_argOutput );
89 ercJob->m_filename = m_argInput;
91 ercJob->SetVarOverrides( m_argDefineVars );
115 ercJob->m_severity = severity;
119 if( units == wxS(
"mm" ) )
123 else if( units == wxS(
"in" ) )
127 else if( units == wxS(
"mils" ) )
131 else if( !units.IsEmpty() )
133 wxFprintf( stderr,
_(
"Invalid units specified\n" ) );
139 if( format ==
"report" )
143 else if( format ==
"json" )
149 wxFprintf( stderr,
_(
"Invalid report format\n" ) );
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)
#define ARG_SEVERITY_EXCLUSIONS
#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)