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" ) ) )
 
   73            .help( 
UTF8STDSTR( 
_( 
"Report all excluded ERC violations, this can be combined " 
   74                                  "with the other severity arguments" ) ) )
 
   78            .help( 
UTF8STDSTR( 
_( 
"Return a nonzero exit code if ERC violations exist" ) ) )
 
 
   85    std::unique_ptr<JOB_SCH_ERC> ercJob( 
new JOB_SCH_ERC() );
 
  114        ercJob->m_severity = severity;
 
  118    if( units == wxS( 
"mm" ) )
 
  122    else if( units == wxS( 
"in" ) )
 
  126    else if( units == wxS( 
"mils" ) )
 
  130    else if( !units.IsEmpty() )
 
  132        wxFprintf( stderr, 
_( 
"Invalid units specified\n" ) );
 
  138    if( format == 
"report" )
 
  142    else if( format == 
"json" )
 
  148        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.
 
std::map< wxString, wxString > m_argDefineVars
Value of the drawing sheet arg if configured.
 
argparse::ArgumentParser m_argParser
 
COMMAND(const std::string &aName)
Define a new COMMAND instance.
 
void addDefineArg()
Set up the drawing sheet arg used by many of the export commands.
 
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_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)