Lazily fix the output arg string for sch svg export

Big brain, just use the string with the colon in it. Sue me.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13647
This commit is contained in:
Marek Roszko 2023-01-24 23:36:38 -05:00
parent ae812bdf39
commit bc65f3b515
3 changed files with 17 additions and 6 deletions

View File

@ -28,15 +28,26 @@
#include <wx/tokenzr.h>
#include <wx/crt.h>
CLI::EXPORT_PCB_BASE_COMMAND::EXPORT_PCB_BASE_COMMAND( const std::string& aName ) : COMMAND( aName )
CLI::EXPORT_PCB_BASE_COMMAND::EXPORT_PCB_BASE_COMMAND( const std::string& aName,
bool aOutputIsDir ) :
COMMAND( aName )
{
m_selectedLayersSet = false;
m_requireLayers = false;
m_hasLayerArg = false;
m_argParser.add_argument( "-o", ARG_OUTPUT )
.default_value( std::string() )
.help( UTF8STDSTR( _( "Output file name" ) ) );
if( aOutputIsDir )
{
m_argParser.add_argument( "-o", ARG_OUTPUT )
.default_value( std::string() )
.help( UTF8STDSTR( _( "Output directory:" ) ) ); // todo fix after string freeze in v8
}
else
{
m_argParser.add_argument( "-o", ARG_OUTPUT )
.default_value( std::string() )
.help( UTF8STDSTR( _( "Output file name" ) ) );
}
m_argParser.add_argument( ARG_INPUT ).help( UTF8STDSTR( _( "Input file" ) ) );

View File

@ -40,7 +40,7 @@ namespace CLI
struct EXPORT_PCB_BASE_COMMAND : public COMMAND
{
EXPORT_PCB_BASE_COMMAND( const std::string& aName );
EXPORT_PCB_BASE_COMMAND( const std::string& aName, bool aOutputIsDir = false );
protected:
int doPerform( KIWAY& aKiway ) override;

View File

@ -31,7 +31,7 @@
#define ARG_EXCLUDE_DRAWING_SHEET "--exclude-drawing-sheet"
#define ARG_NO_BACKGROUND_COLOR "--no-background-color"
CLI::EXPORT_SCH_SVG_COMMAND::EXPORT_SCH_SVG_COMMAND() : EXPORT_PCB_BASE_COMMAND( "svg" )
CLI::EXPORT_SCH_SVG_COMMAND::EXPORT_SCH_SVG_COMMAND() : EXPORT_PCB_BASE_COMMAND( "svg", true )
{
m_argParser.add_argument( "-t", ARG_THEME )
.default_value( std::string() )