32 m_argParser( aName,
"", argparse::default_arguments::none ),
41 .default_value(
false )
43 .implicit_value(
true )
52 wxPrintf(
From_UTF8( ss.str().c_str() ) );
85 for(
const std::string& def : defines )
91 if( bits.Count() == 2 )
128 .metavar(
"INPUT_DIR" );
133 .metavar(
"INPUT_FILE" );
141 .default_value( std::string() )
143 .metavar(
"OUTPUT_DIR" );
148 .default_value( std::string() )
150 .metavar(
"OUTPUT_FILE" );
161 .default_value( std::string() )
162 .help(
UTF8STDSTR(
_(
"Path to drawing sheet, this overrides any existing project "
163 "defined sheet when used" ) ) )
164 .metavar(
"SHEET_PATH" );
173 .default_value( std::vector<std::string>() )
176 _(
"Overrides or adds project variables, can be used multiple times to "
177 "declare multiple variables."
178 "\nUse in the format of '--define-var key=value' or '-D key=value'" ) ) )
179 .metavar(
"KEY=VALUE" );
std::string m_name
Name of this command that is exported and used in the cli.
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.
virtual int doPerform(KIWAY &aKiway)
The internal handler that should be overloaded to implement command specific processing and work.
bool m_hasDefineArg
Whether or not the input arg was added for parsing.
argparse::ArgumentParser m_argParser
bool m_hasOutputArg
Whether or not the output arg was added for parsing.
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.
bool m_outputArgExpectsDir
Whether or not the output arg is expecting a directory.
int Perform(KIWAY &aKiway)
Entry point to processing commands from args and doing work.
wxString m_argDrawingSheet
Value of the drawing sheet arg if configured.
wxString m_argOutput
Value of the output arg if configured.
wxString m_argInput
Value of the common input arg if configured.
bool m_hasInputArg
Whether or not the input arg was added for parsing.
void addDrawingSheetArg()
Set up the drawing sheet arg used by many of the export commands.
bool m_hasDrawingSheetArg
Whether or not the input arg was added for parsing.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
#define ARG_DRAWING_SHEET
#define ARG_DEFINE_VAR_LONG
#define ARG_DEFINE_VAR_SHORT
This file contains miscellaneous commonly used macros and functions.
static const int ERR_ARGS
wxString From_UTF8(const char *cstring)
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.