KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kicad_cli.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25
26#include <wx/filename.h>
27#include <wx/log.h>
28#include <wx/stdpaths.h>
29#include <wx/wxcrtvararg.h> //for wxPrintf
30
31#include <kiway.h>
33#include <string_utils.h>
34#include <paths.h>
37#include <systemdirsappend.h>
38#include <trace_helpers.h>
39
40#include <cctype>
41#include <set>
42#include <stdexcept>
43
44#include "pgm_kicad.h"
45#include "kicad_manager_frame.h"
46
47#include <build_version.h>
48#include <kiplatform/app.h>
50#include <locale_io.h>
51
52#include <git/git_backend.h>
53#include <git/libgit_backend.h>
54
55#include "cli/command_jobset.h"
57#include "cli/command_pcb.h"
59#include "cli/command_pcb_drc.h"
82#include "cli/command_fp.h"
86#include "cli/command_sch.h"
87#include "cli/command_sch_erc.h"
90#include "cli/command_sym.h"
94#include "cli/command_gerber.h"
99#include "cli/command_version.h"
100#include "cli/exit_codes.h"
101
102#ifdef KICAD_IPC_API
104#endif
105
106// Add this header after all others, to avoid a collision name in a Windows header
107// on mingw.
108#include <wx/app.h>
109
110// a dummy to quiet linking with EDA_BASE_FRAME::config();
111#include <kiface_base.h>
112#include <thread_pool.h>
113
114
116{
117 // This function should never be called. It is only referenced from
118 // EDA_BASE_FRAME::config() and this is only provided to satisfy the linker,
119 // not to be actually called.
120 wxLogFatalError( wxT( "Unexpected call to Kiface() in kicad/kicad.cpp" ) );
121
122 throw std::logic_error( "Unexpected call to Kiface() in kicad/kicad.cpp" );
123}
124
125
127{
129
130 std::vector<COMMAND_ENTRY> subCommands;
131
133 handler( aHandler ) {};
134 COMMAND_ENTRY( CLI::COMMAND* aHandler, std::vector<COMMAND_ENTRY> aSub ) :
135 handler( aHandler ),
136 subCommands( aSub ) {};
137};
138
148static CLI::PCB_EXPORT_3D_COMMAND exportPcbGlbCmd{ "glb", UTF8STDSTR( _( "Export GLB (binary GLTF)" ) ),
214
215#ifdef KICAD_IPC_API
216static CLI::API_SERVER_COMMAND apiServerCmd{};
217#endif
218
219// clang-format off
220static std::vector<COMMAND_ENTRY> commandStack = {
221 {
222 &jobsetCmd,
223 {
224 {
226 }
227 }
228 },
229 {
230 &fpCmd,
231 {
232 {
234 {
236 }
237 },
238 {
240 }
241 }
242 },
243 {
244 &pcbCmd,
245 {
246 {
247 &pcbDrcCmd
248 },
249 {
251 },
252 {
254 },
255 {
257 {
282 }
283 },
284 {
286 }
287 }
288 },
289 {
290 &schCmd,
291 {
292 {
293 &schErcCmd
294 },
295 {
297 {
307 }
308 },
309 {
311 }
312 }
313 },
314 {
315 &symCmd,
316 {
317 {
319 {
321 }
322 },
323 {
325 }
326 }
327 },
328 {
329 &gerberCmd,
330 {
331 {
333 {
334 {
336 }
337 }
338 },
339 {
341 },
342 {
344 }
345 }
346 },
347 {
348 &versionCmd,
349 }
350#ifdef KICAD_IPC_API
351 ,
352 {
353 &apiServerCmd,
354 }
355#endif
356};
357// clang-format on
358
359
360static void recurseArgParserBuild( argparse::ArgumentParser& aArgParser, COMMAND_ENTRY& aEntry )
361{
362 aArgParser.add_subparser( aEntry.handler->GetArgParser() );
363
364 for( COMMAND_ENTRY& subEntry : aEntry.subCommands )
365 {
366 recurseArgParserBuild( aEntry.handler->GetArgParser(), subEntry );
367 }
368}
369
370
371static COMMAND_ENTRY* recurseArgParserSubCommandUsed( argparse::ArgumentParser& aArgParser, COMMAND_ENTRY& aEntry )
372{
373 COMMAND_ENTRY* cliCmd = nullptr;
374
375 if( aArgParser.is_subcommand_used( aEntry.handler->GetName() ) )
376 {
377 for( COMMAND_ENTRY& subentry : aEntry.subCommands )
378 {
379 cliCmd = recurseArgParserSubCommandUsed( aEntry.handler->GetArgParser(), subentry );
380 if( cliCmd )
381 break;
382 }
383
384 if( !cliCmd )
385 cliCmd = &aEntry;
386 }
387
388 return cliCmd;
389}
390
391
392static void printHelp( argparse::ArgumentParser& argParser )
393{
394 std::stringstream ss;
395 ss << argParser;
396 wxPrintf( From_UTF8( ss.str().c_str() ) );
397}
398
399
406static bool looksLikeNegativeVectorValue( const std::string& aValue )
407{
408 if( aValue.empty() || aValue[0] != '-' )
409 return false;
410
411 if( aValue.find( ',' ) == std::string::npos )
412 return false;
413
414 for( size_t i = 1; i < aValue.size(); ++i )
415 {
416 char c = aValue[i];
417
418 if( !std::isdigit( c ) && c != '.' && c != ',' && c != '-' && c != '+' )
419 return false;
420 }
421
422 return true;
423}
424
425
437static std::vector<std::string> preprocessArgs( int argc, char** argv )
438{
439 std::vector<std::string> result;
440
441 static const std::set<std::string> vectorArgs = { "--rotate", "--pan", "--pivot" };
442
443 for( int i = 0; i < argc; ++i )
444 {
445 std::string current( argv[i] );
446
447 if( vectorArgs.count( current ) && i + 1 < argc )
448 {
449 std::string next( argv[i + 1] );
450
452 {
453 result.push_back( current + "='" + next + "'" );
454 ++i;
455 continue;
456 }
457 }
458
459 result.push_back( current );
460 }
461
462 return result;
463}
464
465
467{
469 App().SetAppDisplayName( wxT( "kicad-cli" ) );
470
471#if defined( DEBUG )
472 wxString absoluteArgv0 = wxStandardPaths::Get().GetExecutablePath();
473
474 if( !wxIsAbsolutePath( absoluteArgv0 ) )
475 {
476 wxLogError( wxT( "No meaningful argv[0]" ) );
477 return false;
478 }
479#endif
480
481 // Initialize the git backend so VCS text-eval functions work in CLI mode
482 SetGitBackend( new LIBGIT_BACKEND() );
483 GetGitBackend()->Init();
484
485 if( !InitPgm( true ) )
486 return false;
487
488 m_bm.InitSettings( new KICAD_SETTINGS );
491 m_bm.Init();
492
494
495 return true;
496}
497
498
500{
501 argparse::ArgumentParser argParser( std::string( "kicad-cli" ), GetMajorMinorVersion().ToStdString(),
502 argparse::default_arguments::none );
503
504 argParser.add_argument( "-v", ARG_VERSION )
505 .help( UTF8STDSTR( _( "prints version information and exits" ) ) )
506 .flag()
507 .nargs( 0 );
508
509 argParser.add_argument( ARG_HELP_SHORT, ARG_HELP ).help( UTF8STDSTR( ARG_HELP_DESC ) ).flag().nargs( 0 );
510
511 for( COMMAND_ENTRY& entry : commandStack )
512 {
513 recurseArgParserBuild( argParser, entry );
514 }
515
516 try
517 {
518 // Use the C locale to parse arguments
519 // Otherwise the decimal separator for the locale will be applied
520 LOCALE_IO dummy;
521
522 // Pre-process arguments to handle negative vector values (e.g., --rotate -45,0,45)
523 // which argparse would otherwise interpret as unknown options
524 std::vector<std::string> args = preprocessArgs( m_argcUtf8, m_argvUtf8 );
525 argParser.parse_args( args );
526 }
527 // std::runtime_error doesn't seem to be enough for the scan<>()
528 catch( const std::exception& err )
529 {
530 bool requestedHelp = false;
531
532 for( int i = 0; i < m_argcUtf8; ++i )
533 {
534 if( std::string arg( m_argvUtf8[i] ); arg == ARG_HELP_SHORT || arg == ARG_HELP )
535 {
536 requestedHelp = true;
537 break;
538 }
539 }
540
541 if( !requestedHelp )
542 wxPrintf( "%s\n", err.what() );
543
544 // find the correct argparser object to output the command usage info
545 COMMAND_ENTRY* cliCmd = nullptr;
546 for( COMMAND_ENTRY& entry : commandStack )
547 {
548 if( argParser.is_subcommand_used( entry.handler->GetName() ) )
549 {
550 cliCmd = recurseArgParserSubCommandUsed( argParser, entry );
551 }
552 }
553
554 // arg parser uses a stream overload for printing the help
555 // we want to intercept so we can wxString the utf8 contents
556 // because on windows our terminal codepage might not be utf8
557 if( cliCmd )
558 cliCmd->handler->PrintHelp();
559 else
560 {
561 printHelp( argParser );
562 }
563
564 return requestedHelp ? 0 : CLI::EXIT_CODES::ERR_ARGS;
565 }
566
567 if( argParser[ARG_HELP] == true )
568 {
569 std::stringstream ss;
570 ss << argParser;
571 wxPrintf( From_UTF8( ss.str().c_str() ) );
572
573 return 0;
574 }
575
576 CLI::COMMAND* cliCmd = nullptr;
577
578 // the version arg gets redirected to the version subcommand
579 if( argParser[ARG_VERSION] == true )
580 {
581 cliCmd = &versionCmd;
582 }
583
584 if( !cliCmd )
585 {
586 for( COMMAND_ENTRY& entry : commandStack )
587 {
588 if( argParser.is_subcommand_used( entry.handler->GetName() ) )
589 {
590 COMMAND_ENTRY* cmdSubEntry = recurseArgParserSubCommandUsed( argParser, entry );
591 if( cmdSubEntry != nullptr )
592 {
593 cliCmd = cmdSubEntry->handler;
594 break;
595 }
596 }
597 }
598 }
599
600 if( cliCmd )
601 {
602 int exitCode = cliCmd->Perform( Kiway );
603
604 if( exitCode != CLI::EXIT_CODES::AVOID_CLOSING )
605 {
606 return exitCode;
607 }
608 else
609 {
610 return 0;
611 }
612 }
613 else
614 {
615 printHelp( argParser );
616
618 }
619}
620
621
623{
624 // Abort and wait on any background jobs
625 GetKiCadThreadPool().purge();
626 GetKiCadThreadPool().wait();
627
629
631 {
633 m_settings_manager->Save();
634 }
635
636 if( GetGitBackend() )
637 {
639 delete GetGitBackend();
640 SetGitBackend( nullptr );
641 }
642
643 // Destroy everything in PGM_KICAD,
644 // especially wxSingleInstanceCheckerImpl earlier than wxApp and earlier
645 // than static destruction would.
646 Destroy();
647}
648
649
650void PGM_KICAD::MacOpenFile( const wxString& aFileName )
651{
652#if defined( __WXMAC__ )
653 wxFAIL_MSG( "kicad-cli should not call MacOpenFile" );
654#endif
655}
656
657
659{
660 // unlike a normal destructor, this is designed to be called more
661 // than once safely:
662
663 m_bm.End();
664
666}
667
668
670
672
676struct APP_KICAD_CLI : public wxAppConsole
677{
679 wxAppConsole()
680 {
681 SetPgm( &program );
682
683 // Init the environment each platform wants
685 }
686
687
688 bool OnInit() override
689 {
690 // Perform platform-specific init tasks
691 if( !KIPLATFORM::APP::Init() )
692 return false;
693
694#ifndef DEBUG
695 // Enable logging traces to the console in release build.
696 // This is usually disabled, but it can be useful for users to run to help
697 // debug issues and other problems.
698 if( wxGetEnv( wxS( "KICAD_ENABLE_WXTRACE" ), nullptr ) )
699 {
700 wxLog::EnableLogging( true );
701 wxLog::SetLogLevel( wxLOG_Trace );
702 }
703#endif
704
705 if( !program.OnPgmInit() )
706 {
707 program.OnPgmExit();
708 return false;
709 }
710
711 return true;
712 }
713
714 int OnExit() override
715 {
716 // Drain any pending wx-managed objects before tearing down PGM_BASE
717 // singletons so destructors can still call into Pgm(). See
718 // https://gitlab.com/kicad/code/kicad/-/issues/23373 for the GUI variant
719 // of this hazard; kept consistent with the GUI apps for parity.
720 int ret = wxAppConsole::OnExit();
721
722#if defined( __FreeBSD__ )
723 // Avoid wxLog crashing when used in destructors invoked from OnPgmExit().
724 wxLog::EnableLogging( false );
725#endif
726
727 program.OnPgmExit();
728 return ret;
729 }
730
731 int OnRun() override
732 {
733 try
734 {
735 return program.OnPgmRun();
736 }
737 catch( ... )
738 {
739 Pgm().HandleException( std::current_exception() );
740 }
741
742 return -1;
743 }
744
745 int FilterEvent( wxEvent& aEvent ) override { return Event_Skip; }
746
747#if defined( DEBUG )
751 bool ProcessEvent( wxEvent& aEvent ) override
752 {
753 if( aEvent.GetEventType() == wxEVT_CHAR || aEvent.GetEventType() == wxEVT_CHAR_HOOK )
754 {
755 wxKeyEvent* keyEvent = static_cast<wxKeyEvent*>( &aEvent );
756
757 if( keyEvent )
758 {
759 wxLogTrace( kicadTraceKeyEvent, "APP_KICAD::ProcessEvent %s", dump( *keyEvent ) );
760 }
761 }
762
763 aEvent.Skip();
764 return false;
765 }
766
774 bool OnExceptionInMainLoop() override
775 {
776 try
777 {
778 throw;
779 }
780 catch( ... )
781 {
782 Pgm().HandleException( std::current_exception() );
783 }
784
785 return false; // continue on. Return false to abort program
786 }
787#endif
788};
789
790IMPLEMENT_APP_CONSOLE( APP_KICAD_CLI )
791
792
793// The C++ project manager supports one open PROJECT, so Prj() calls within
794// this link image need this function.
796{
797 return Kiway.Prj();
798}
wxString GetMajorMinorVersion()
Get only the major and minor version in a string major.minor.
argparse::ArgumentParser & GetArgParser()
Definition command.h:60
const std::string & GetName() const
Definition command.h:61
void PrintHelp()
Definition command.cpp:47
int Perform(KIWAY &aKiway)
Entry point to processing commands from args and doing work.
Definition command.cpp:55
virtual void Shutdown()=0
virtual void Init()=0
A KIFACE implementation.
Definition kiface_base.h:39
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:315
void OnKiwayEnd()
Definition kiway.cpp:815
void LoadGlobalTables(std::initializer_list< LIBRARY_TABLE_TYPE > aTablesToLoad={})
(Re)loads the global library tables in the given list, or all tables if no list is given
virtual wxApp & App()
Return a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe.
Definition pgm_base.cpp:211
int m_argcUtf8
Definition pgm_base.h:449
std::unique_ptr< SETTINGS_MANAGER > m_settings_manager
Definition pgm_base.h:411
void Destroy()
Definition pgm_base.cpp:190
char ** m_argvUtf8
argv parameters converted to utf8 form because wxWidgets has opinions.
Definition pgm_base.h:447
void HandleException(std::exception_ptr aPtr, bool aUnhandled=false)
A exception handler to be used at the top level if exceptions bubble up that for.
Definition pgm_base.cpp:802
void BuildArgvUtf8()
Builds the UTF8 based argv variable.
Definition pgm_base.cpp:282
bool InitPgm(bool aHeadless=false, bool aIsUnitTest=false)
Initialize this program.
Definition pgm_base.cpp:327
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition pgm_base.h:130
virtual LIBRARY_MANAGER & GetLibraryManager() const
Definition pgm_base.h:132
void SaveCommonSettings()
Save the program (process) settings subset which are stored .kicad_common.
Definition pgm_base.cpp:532
PGM_KICAD extends PGM_BASE to bring in FileHistory() and PdfBrowser() which were moved from EDA_APP i...
Definition pgm_kicad.h:42
bool OnPgmInit()
Definition kicad.cpp:95
void Destroy()
Definition kicad.cpp:468
void MacOpenFile(const wxString &aFileName) override
Specific to MacOSX (not used under Linux or Windows).
Definition kicad.cpp:455
void OnPgmExit()
Definition kicad.cpp:422
APP_SETTINGS_BASE * PgmSettings()
Definition pgm_kicad.h:59
int OnPgmRun()
Definition kicad.cpp:416
BIN_MOD m_bm
Definition pgm_kicad.h:72
Container for project specific data.
Definition project.h:66
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Take ownership of the pointer passed in.
void SetKiway(KIWAY *aKiway)
Associate this setting manager with the given Kiway.
#define ARG_HELP
Definition command.h:30
#define UTF8STDSTR(s)
Definition command.h:27
#define ARG_HELP_DESC
Definition command.h:32
#define ARG_VERSION
Definition command.h:29
#define ARG_HELP_SHORT
Definition command.h:31
#define _(s)
void SetGitBackend(GIT_BACKEND *aBackend)
GIT_BACKEND * GetGitBackend()
const wxChar *const kicadTraceKeyEvent
Flag to enable wxKeyEvent debug tracing.
PROJECT & Prj()
Definition kicad.cpp:669
static CLI::PCB_EXPORT_SVG_COMMAND exportPcbSvgCmd
static CLI::SCH_EXPORT_PLOT_COMMAND exportSchHpglCmd
static CLI::SCH_EXPORT_PLOT_COMMAND exportSchSvgCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcbVrmlCmd
static CLI::GERBER_INFO_COMMAND gerberInfoCmd
static CLI::PCB_EXPORT_STATS_COMMAND exportPcbStatsCmd
static CLI::PCB_EXPORT_DXF_COMMAND exportPcbDxfCmd
static CLI::SCH_ERC_COMMAND schErcCmd
static CLI::PCB_EXPORT_HPGL_COMMAND exportPcbHpglCmd
static CLI::PCB_DRC_COMMAND pcbDrcCmd
static std::vector< std::string > preprocessArgs(int argc, char **argv)
Pre-process command line arguments to handle negative numeric values.
static CLI::PCB_IMPORT_COMMAND pcbImportCmd
static CLI::FP_EXPORT_SVG_COMMAND fpExportSvgCmd
static CLI::PCB_EXPORT_COMMAND exportPcbCmd
static CLI::PCB_RENDER_COMMAND pcbRenderCmd
static bool looksLikeNegativeVectorValue(const std::string &aValue)
Check if a string looks like a numeric vector value that happens to start with a minus sign.
static CLI::SYM_UPGRADE_COMMAND symUpgradeCmd
static CLI::FP_EXPORT_COMMAND fpExportCmd
static CLI::SCH_EXPORT_PYTHONBOM_COMMAND exportSchPythonBomCmd
static CLI::FP_UPGRADE_COMMAND fpUpgradeCmd
static CLI::SCH_EXPORT_PLOT_COMMAND exportSchPdfCmd
static void printHelp(argparse::ArgumentParser &argParser)
static CLI::JOBSET_RUN_COMMAND jobsetRunCmd
static CLI::PCB_UPGRADE_COMMAND pcbUpgradeCmd
static CLI::PCB_EXPORT_POS_COMMAND exportPcbPosCmd
static CLI::GERBER_DIFF_COMMAND gerberDiffCmd
static CLI::PCB_EXPORT_PS_COMMAND exportPcbPsCmd
static CLI::GERBER_COMMAND gerberCmd
static CLI::SYM_COMMAND symCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcbStepCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcbPlyCmd
static CLI::PCB_EXPORT_GERBERS_COMMAND exportPcbGerbersCmd
static PGM_KICAD program
static CLI::SCH_EXPORT_BOM_COMMAND exportSchBomCmd
static CLI::GERBER_CONVERT_PNG_COMMAND gerberConvertPngCmd
static CLI::PCB_EXPORT_IPCD356_COMMAND exportPcbIpcD356Cmd
static CLI::SCH_COMMAND schCmd
static CLI::PCB_COMMAND pcbCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcb3DPDFCmd
static std::vector< COMMAND_ENTRY > commandStack
static CLI::PCB_EXPORT_DRILL_COMMAND exportPcbDrillCmd
static CLI::SCH_EXPORT_PLOT_COMMAND exportSchPngCmd
static CLI::PCB_EXPORT_IPC2581_COMMAND exportPcbIpc2581Cmd
static CLI::SCH_EXPORT_PLOT_COMMAND exportSchDxfCmd
static CLI::JOBSET_COMMAND jobsetCmd
static CLI::SYM_EXPORT_COMMAND symExportCmd
static CLI::SYM_EXPORT_SVG_COMMAND symExportSvgCmd
static COMMAND_ENTRY * recurseArgParserSubCommandUsed(argparse::ArgumentParser &aArgParser, COMMAND_ENTRY &aEntry)
static CLI::PCB_EXPORT_3D_COMMAND exportPcbU3DCmd
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static CLI::PCB_EXPORT_ODB_COMMAND exportPcbOdbCmd
static CLI::VERSION_COMMAND versionCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcbStlCmd
static CLI::PCB_EXPORT_PDF_COMMAND exportPcbPdfCmd
static CLI::SCH_UPGRADE_COMMAND schUpgradeCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcbXaoCmd
static void recurseArgParserBuild(argparse::ArgumentParser &aArgParser, COMMAND_ENTRY &aEntry)
static CLI::SCH_EXPORT_NETLIST_COMMAND exportSchNetlistCmd
static CLI::PCB_EXPORT_PNG_COMMAND exportPcbPngCmd
static CLI::SCH_EXPORT_PLOT_COMMAND exportSchPostscriptCmd
static CLI::PCB_EXPORT_GENCAD_COMMAND exportPcbGencadCmd
static CLI::GERBER_CONVERT_COMMAND gerberConvertCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcbStepzCmd
static CLI::FP_COMMAND fpCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcbGlbCmd
static CLI::SCH_EXPORT_COMMAND exportSchCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcbBrepCmd
#define KFCTL_CPP_PROJECT_SUITE
Running under C++ project mgr, possibly with others.
Definition kiway.h:164
#define KFCTL_CLI
Running as CLI app.
Definition kiway.h:165
static const int ERR_ARGS
Definition exit_codes.h:31
static const int AVOID_CLOSING
Definition exit_codes.h:28
bool Init()
Perform application-specific initialization tasks.
Definition unix/app.cpp:40
void Init()
Perform environment initialization tasks.
void SetPgm(PGM_BASE *pgm)
PGM_BASE & Pgm()
The global program "get" accessor.
CITER next(CITER it)
Definition ptree.cpp:124
PGM_SINGLE_TOP program
KIWAY Kiway(KFCTL_STANDALONE)
std::vector< FAB_LAYER_COLOR > dummy
wxString From_UTF8(const char *cstring)
Not publicly visible because most of the action is in PGM_KICAD these days.
int OnExit() override
bool OnInit() override
int FilterEvent(wxEvent &aEvent) override
int OnRun() override
COMMAND_ENTRY(CLI::COMMAND *aHandler)
COMMAND_ENTRY(CLI::COMMAND *aHandler, std::vector< COMMAND_ENTRY > aSub)
CLI::COMMAND * handler
std::vector< COMMAND_ENTRY > subCommands
System directories search utilities.
wxString result
Test unit parsing edge cases and error handling.
thread_pool & GetKiCadThreadPool()
Get a reference to the current thread pool.
wxString dump(const wxArrayString &aArray)
Debug helper for printing wxArrayString contents.
wxLogTrace helper definitions.