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(
"" ) )
88 .default_value( std::string(
"," ) )
89 .metavar(
"FIELD_DELIM" );
93 .default_value( std::string(
"\"" ) )
94 .metavar(
"STR_DELIM" );
98 .default_value( std::string(
"," ) )
99 .metavar(
"REF_DELIM" );
103 .default_value( std::string(
"-" ) )
104 .metavar(
"REF_RANGE_DELIM" );
118 std::vector<wxString> v;
120 if( !aList.IsEmpty() )
122 wxStringTokenizer layerTokens( aList,
"," );
124 while( layerTokens.HasMoreTokens() )
125 v.emplace_back( layerTokens.GetNextToken() );
133 std::unique_ptr<JOB_EXPORT_SCH_BOM> bomJob = std::make_unique<JOB_EXPORT_SCH_BOM>();
136 bomJob->m_filename = m_argInput;
137 bomJob->SetOutputPath( m_argOutput );
140 bomJob->m_bomFmtPresetName =
144 bomJob->m_fieldDelimiter =
146 bomJob->m_stringDelimiter =
149 bomJob->m_refRangeDelimiter =
155 bomJob->m_fieldsOrdered =
157 bomJob->m_fieldsLabels =
163 bomJob->m_fieldsLabels.clear();
166 bomJob->m_fieldsGroupBy =
169 bomJob->m_sortAsc = m_argParser.get<
bool>(
ARG_SORT_ASC );
174 if( !wxFile::Exists( bomJob->m_filename ) )
176 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)
#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_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)