Fix up the top level cli command entries

This commit is contained in:
Marek Roszko 2022-11-28 20:57:24 -05:00
parent 25d5defc10
commit 4a88d2a74d
8 changed files with 16 additions and 85 deletions

View File

@ -16,6 +16,7 @@ include_directories(
)
set( KICAD_SRCS
cli/command.cpp
cli/command_export_pcb_base.cpp
cli/command_export_pcb_drill.cpp
cli/command_export_pcb_dxf.cpp
@ -24,15 +25,12 @@ set( KICAD_SRCS
cli/command_export_pcb_pos.cpp
cli/command_export_pcb_step.cpp
cli/command_export_pcb_svg.cpp
cli/command_fp.cpp
cli/command_fp_upgrade.cpp
cli/command_pcb.cpp
cli/command_pcb_export.cpp
cli/command_export_sch_bom.cpp
cli/command_export_sch_netlist.cpp
cli/command_export_sch_pdf.cpp
cli/command_export_sch_svg.cpp
cli/command_sch.cpp
cli/command_sch_export.cpp
dialogs/dialog_template_selector_base.cpp
dialogs/dialog_template_selector.cpp

View File

@ -18,15 +18,18 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "command_fp.h"
#include "command.h"
#include <cli/exit_codes.h>
#include <wx/crt.h>
#include <macros.h>
CLI::FP_COMMAND::FP_COMMAND() : COMMAND( "fp" )
#include <sstream>
int CLI::COMMAND::Perform( KIWAY& aKiway )
{
}
std::stringstream ss;
ss << m_argParser;
wxPrintf( FROM_UTF8( ss.str().c_str() ) );
int CLI::FP_COMMAND::Perform( KIWAY& aKiway )
{
std::cout << m_argParser;
return 1;
return EXIT_CODES::OK;
}

View File

@ -37,7 +37,7 @@ public:
m_name( aName ),
m_argParser( aName, "", aDefaultArgs ){};
virtual int Perform( KIWAY& aKiway ) = 0;
virtual int Perform( KIWAY& aKiway );
virtual ~COMMAND() = default;

View File

@ -27,9 +27,7 @@ namespace CLI
{
struct FP_COMMAND : public COMMAND
{
FP_COMMAND();
int Perform( KIWAY& aKiway ) override;
FP_COMMAND() : COMMAND( "fp" ) {}
};
}

View File

@ -1,32 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2022 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "command_pcb.h"
CLI::PCB_COMMAND::PCB_COMMAND() : COMMAND( "pcb" )
{
}
int CLI::PCB_COMMAND::Perform( KIWAY& aKiway )
{
std::cout << m_argParser;
return 1;
}

View File

@ -27,9 +27,7 @@ namespace CLI
{
struct PCB_COMMAND : public COMMAND
{
PCB_COMMAND();
int Perform( KIWAY& aKiway ) override;
PCB_COMMAND() : COMMAND( "pcb" ) {}
};
}

View File

@ -1,32 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2022 Mark Roszko <mark.roszko@gmail.com>
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "command_sch.h"
CLI::SCH_COMMAND::SCH_COMMAND() : COMMAND( "sch" )
{
}
int CLI::SCH_COMMAND::Perform( KIWAY& aKiway )
{
std::cout << m_argParser;
return 1;
}

View File

@ -27,9 +27,7 @@ namespace CLI
{
struct SCH_COMMAND : public COMMAND
{
SCH_COMMAND();
int Perform( KIWAY& aKiway ) override;
SCH_COMMAND() : COMMAND( "sch" ) { }
};
}