28#include <wx/tokenzr.h>
42 .default_value( std::string(
"" ) )
47 .default_value( std::string(
"" ) )
48 .metavar(
"FMT_PRESET" );
53 .default_value( std::string(
"Reference,Value,Footprint,${QUANTITY},${DNP}" ) )
58 .default_value( std::string(
"Refs,Value,Footprint,Qty,DNP" ) )
63 .default_value( std::string(
"" ) )
64 .metavar(
"GROUP_BY" );
68 .default_value( std::string(
"Reference" ) )
69 .metavar(
"SORT_BY" );
73 .implicit_value(
true )
74 .default_value(
true );
78 .default_value( std::string(
"" ) )
92 .default_value( std::string(
"," ) )
93 .metavar(
"FIELD_DELIM" );
97 .default_value( std::string(
"\"" ) )
98 .metavar(
"STR_DELIM" );
102 .default_value( std::string(
"," ) )
103 .metavar(
"REF_DELIM" );
107 .default_value( std::string(
"-" ) )
108 .metavar(
"REF_RANGE_DELIM" );
122 std::vector<wxString> v;
124 if( !aList.IsEmpty() )
126 wxStringTokenizer layerTokens( aList,
"," );
128 while( layerTokens.HasMoreTokens() )
129 v.emplace_back( layerTokens.GetNextToken() );
137 std::unique_ptr<JOB_EXPORT_SCH_BOM> bomJob = std::make_unique<JOB_EXPORT_SCH_BOM>();
140 bomJob->m_filename = m_argInput;
141 bomJob->SetConfiguredOutputPath( m_argOutput );
144 bomJob->m_bomFmtPresetName =
148 bomJob->m_fieldDelimiter =
150 bomJob->m_stringDelimiter =
153 bomJob->m_refRangeDelimiter =
159 bomJob->m_fieldsOrdered =
161 bomJob->m_fieldsLabels =
167 bomJob->m_fieldsLabels.clear();
170 bomJob->m_fieldsGroupBy =
173 bomJob->m_sortAsc = m_argParser.get<
bool>(
ARG_SORT_ASC );
178 if( !wxFile::Exists( bomJob->m_filename ) )
180 wxFprintf( stderr,
_(
"Schematic file does not exist or is not accessible\n" ) );
argparse::ArgumentParser m_argParser
void addCommonArgs(bool aInput, bool aOutput, bool aInputIsDir, bool aOutputIsDir)
Set 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.
std::vector< wxString > convertStringList(const wxString &aList)
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_STRING_DELIMITER
#define ARG_GROUP_BY_DESC
#define ARG_INCLUDE_EXCLUDED_FROM_BOM
#define ARG_KEEP_LINE_BREAKS_DESC
#define ARG_EXCLUDE_DNP_DESC
#define ARG_SORT_FIELD_DESC
#define ARG_REF_DELIMITER_DESC
#define ARG_KEEP_TABS_DESC
#define ARG_STRING_DELIMITER_DESC
#define ARG_KEEP_LINE_BREAKS
#define ARG_FMT_PRESET_DESC
#define ARG_INCLUDE_EXCLUDED_FROM_BOM_DESC
#define ARG_FIELD_DELIMITER_DESC
#define ARG_FIELD_DELIMITER
#define ARG_REF_DELIMITER
#define ARG_REF_RANGE_DELIMITER
#define ARG_SORT_ASC_DESC
#define ARG_REF_RANGE_DELIMITER_DESC
This file contains miscellaneous commonly used macros and functions.
static const int ERR_INVALID_INPUT_FILE
wxString From_UTF8(const char *cstring)