From ee92ace41986b8f3e935e2b7e277d17b00a1d8f8 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Wed, 26 Oct 2022 07:08:17 -0400 Subject: [PATCH] Fix some cli switch values --- common/cli/command_export_pcb_dxf.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/common/cli/command_export_pcb_dxf.cpp b/common/cli/command_export_pcb_dxf.cpp index 7bd3615588..990199fe47 100644 --- a/common/cli/command_export_pcb_dxf.cpp +++ b/common/cli/command_export_pcb_dxf.cpp @@ -42,19 +42,19 @@ CLI::EXPORT_PCB_DXF_COMMAND::EXPORT_PCB_DXF_COMMAND() : EXPORT_PCB_BASE_COMMAND( .help( "comma separated list of untranslated layer names to include such as F.Cu,B.Cu" ); m_argParser.add_argument( "-ird", ARG_INCLUDE_REFDES ) - .help( "Mirror the board (useful for trying to show bottom layers)" ) + .help( "Include the reference designator text" ) .implicit_value( true ) - .default_value( true ); + .default_value( false ); m_argParser.add_argument( "-iv", ARG_INCLUDE_VALUE ) - .help( "Mirror the board (useful for trying to show bottom layers)" ) + .help( "Include the value text" ) .implicit_value( true ) - .default_value( true ); + .default_value( false ); m_argParser.add_argument( "-uc", ARG_USE_CONTOURS ) .help( "Plot graphic items using their contours" ) .implicit_value( true ) - .default_value( true ); + .default_value( false ); m_argParser.add_argument( "-ou", ARG_OUTPUT_UNITS ) .default_value( std::string( "in" ) ) @@ -69,6 +69,12 @@ int CLI::EXPORT_PCB_DXF_COMMAND::Perform( KIWAY& aKiway ) const dxfJob->m_filename = FROM_UTF8( m_argParser.get( ARG_INPUT ).c_str() ); dxfJob->m_outputFile = FROM_UTF8( m_argParser.get( ARG_OUTPUT ).c_str() ); + if( !wxFile::Exists( dxfJob->m_filename ) ) + { + wxFprintf( stderr, _( "Board file does not exist or is not accessible\n" ) ); + return EXIT_CODES::ERR_INVALID_INPUT_FILE; + } + dxfJob->m_plotFootprintValues = m_argParser.get( ARG_INCLUDE_VALUE ); dxfJob->m_plotRefDes = m_argParser.get( ARG_INCLUDE_VALUE ); dxfJob->m_plotGraphicItemsUsingContours = m_argParser.get( ARG_USE_CONTOURS );