32 m_argParser( aName,
"", argparse::default_arguments::none ),
52 wxPrintf(
From_UTF8( ss.str().c_str() ) );
84 for(
const std::string& def : defines )
90 if( bits.Count() == 2 )
105 for(
const auto&
name : variantNames )
113 _(
"When specifying multiple variants, the output path must contain "
114 "${VARIANT} to generate separate output files for each variant.\n" ) );
146 .metavar(
"INPUT_DIR" );
151 .metavar(
"INPUT_FILE" );
159 .default_value( std::string() )
161 .metavar(
"OUTPUT_DIR" );
166 .default_value( std::string() )
168 .metavar(
"OUTPUT_FILE" );
179 .default_value( std::string() )
180 .help(
UTF8STDSTR(
_(
"Path to drawing sheet, this overrides any existing project "
181 "defined sheet when used" ) ) )
182 .metavar(
"SHEET_PATH" );
191 .default_value( std::vector<std::string>() )
194 _(
"Overrides or adds project variables, can be used multiple times to "
195 "declare multiple variables."
196 "\nUse in the format of '--define-var key=value' or '-D key=value'" ) ) )
197 .metavar(
"KEY=VALUE" );
206 .default_value( std::vector<std::string>() )
209 _(
"The variant name(s) to output, can be used multiple times to specify "
210 "multiple variants.\n"
211 "When specifying multiple variants, use ${VARIANT} in the output path to "
212 "generate separate files for each variant.\n"
213 "When no --variant argument is provided the default variant is output." ) ) );
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.
void addVariantsArg()
Set up the list of variants to output arguement.
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.
std::vector< wxString > m_argVariantNames
The list of variant names to output.
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_hasVariantArg
Whether or not the input argument for variant names was added for parsing.
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.