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, see <https://www.gnu.org/licenses/>.
19 */
20
21
22#include <wx/filename.h>
23#include <wx/log.h>
24#include <wx/stdpaths.h>
25#include <wx/wxcrtvararg.h> //for wxPrintf
26
27#include <kiway.h>
29#include <string_utils.h>
30#include <paths.h>
33#include <systemdirsappend.h>
34#include <trace_helpers.h>
35
36#include <cctype>
37#include <set>
38#include <cstdlib>
39
40#include "pgm_kicad.h"
41#include "kicad_manager_frame.h"
42
43#include <build_version.h>
44#include <kiplatform/app.h>
46#include <locale_io.h>
47
48#include <git/git_backend.h>
49#include <git/libgit_backend.h>
50
51#include "cli/command_jobset.h"
53#include "cli/command_pcb.h"
56#include "cli/command_fp_diff.h"
58#include "cli/command_pcb_drc.h"
89#include "cli/command_import.h"
90#include "cli/command_fp.h"
95#include "cli/command_sch.h"
96#include "cli/command_sch_erc.h"
97#include "cli/command_project.h"
102#include "cli/command_sym.h"
107#include "cli/command_gerber.h"
113#include "cli/command_version.h"
114#include "cli/exit_codes.h"
115
116// Add this header after all others, to avoid a collision name in a Windows header
117// on mingw.
118#include <wx/app.h>
119
120// a dummy to quiet linking with EDA_BASE_FRAME::config();
121#include <kiface_base.h>
122#include <thread_pool.h>
123
124
126{
127 // This function should never be called. It is only referenced from
128 // EDA_BASE_FRAME::config() and this is only provided to satisfy the linker,
129 // not to be actually called.
130 wxFprintf( stderr,
131 wxT( "Unexpected call to Kiface() in kicad/kicad_cli.cpp — a "
132 "code path is reaching into a kiface stub from the CLI "
133 "process. Re-run with KICAD_TRACE=KICAD for a backtrace.\n" ) );
134 std::abort();
135}
136
137
139{
141
142 std::vector<COMMAND_ENTRY> subCommands;
143
145 handler( aHandler ) {};
146 COMMAND_ENTRY( CLI::COMMAND* aHandler, std::vector<COMMAND_ENTRY> aSub ) :
147 handler( aHandler ),
148 subCommands( aSub ) {};
149};
150
167static CLI::PCB_EXPORT_3D_COMMAND exportPcbGlbCmd{ "glb", UTF8STDSTR( _( "Export GLB (binary GLTF)" ) ),
245
246// clang-format off
247static std::vector<COMMAND_ENTRY> commandStack = {
248 {
249 &jobsetCmd,
250 {
251 {
253 }
254 }
255 },
256 {
257 &fpCmd,
258 {
259 {
260 &fpDiffCmd
261 },
262 {
264 {
266 }
267 },
268 {
270 },
271 {
273 }
274 }
275 },
276 {
277 &pcbCmd,
278 {
279 {
281 },
282 {
283 &pcbDrcCmd
284 },
285 {
287 },
288 {
290 },
291 {
293 {
322 }
323 },
324 {
326 },
327 {
329 }
330 }
331 },
332 {
333 &projectCmd,
334 {
335 {
337 }
338 }
339 },
340 {
341 &schCmd,
342 {
343 {
345 },
346 {
347 &schErcCmd
348 },
349 {
351 },
352 {
354 {
364 }
365 },
366 {
368 },
369 {
371 }
372 }
373 },
374 {
375 &symCmd,
376 {
377 {
379 },
380 {
382 {
384 }
385 },
386 {
388 },
389 {
391 }
392 }
393 },
394 {
395 &gerberCmd,
396 {
397 {
399 {
400 {
402 }
403 }
404 },
405 {
407 },
408 {
410 }
411 }
412 },
413 {
415 },
416 {
417 // Hidden from --help (set_suppress); invoked by git via the
418 // merge.kicad-*.driver config, not by users.
420 },
421 {
422 &importCmd,
423 },
424 {
425 &versionCmd,
426 },
427 {
429 }
430};
431// clang-format on
432
433
434static void recurseArgParserBuild( argparse::ArgumentParser& aArgParser, COMMAND_ENTRY& aEntry )
435{
436 aArgParser.add_subparser( aEntry.handler->GetArgParser() );
437
438 for( COMMAND_ENTRY& subEntry : aEntry.subCommands )
439 {
440 recurseArgParserBuild( aEntry.handler->GetArgParser(), subEntry );
441 }
442}
443
444
445static COMMAND_ENTRY* recurseArgParserSubCommandUsed( argparse::ArgumentParser& aArgParser, COMMAND_ENTRY& aEntry )
446{
447 COMMAND_ENTRY* cliCmd = nullptr;
448
449 if( aArgParser.is_subcommand_used( aEntry.handler->GetName() ) )
450 {
451 for( COMMAND_ENTRY& subentry : aEntry.subCommands )
452 {
453 cliCmd = recurseArgParserSubCommandUsed( aEntry.handler->GetArgParser(), subentry );
454 if( cliCmd )
455 break;
456 }
457
458 if( !cliCmd )
459 cliCmd = &aEntry;
460 }
461
462 return cliCmd;
463}
464
465
466static void printHelp( argparse::ArgumentParser& argParser )
467{
468 std::stringstream ss;
469 ss << argParser;
470 wxPrintf( From_UTF8( ss.str().c_str() ) );
471}
472
473
480static bool looksLikeNegativeVectorValue( const std::string& aValue )
481{
482 if( aValue.empty() || aValue[0] != '-' )
483 return false;
484
485 if( aValue.find( ',' ) == std::string::npos )
486 return false;
487
488 for( size_t i = 1; i < aValue.size(); ++i )
489 {
490 char c = aValue[i];
491
492 if( !std::isdigit( c ) && c != '.' && c != ',' && c != '-' && c != '+' )
493 return false;
494 }
495
496 return true;
497}
498
499
511static std::vector<std::string> preprocessArgs( int argc, char** argv )
512{
513 std::vector<std::string> result;
514
515 static const std::set<std::string> vectorArgs = { "--rotate", "--pan", "--pivot" };
516
517 for( int i = 0; i < argc; ++i )
518 {
519 std::string current( argv[i] );
520
521 if( vectorArgs.count( current ) && i + 1 < argc )
522 {
523 std::string next( argv[i + 1] );
524
526 {
527 result.push_back( current + "='" + next + "'" );
528 ++i;
529 continue;
530 }
531 }
532
533 result.push_back( current );
534 }
535
536 return result;
537}
538
539
541{
543 App().SetAppDisplayName( wxT( "kicad-cli" ) );
544
545#if defined( DEBUG )
546 wxString absoluteArgv0 = wxStandardPaths::Get().GetExecutablePath();
547
548 if( !wxIsAbsolutePath( absoluteArgv0 ) )
549 {
550 wxLogError( wxT( "No meaningful argv[0]" ) );
551 return false;
552 }
553#endif
554
555 // Initialize the git backend so VCS text-eval functions work in CLI mode
556 SetGitBackend( new LIBGIT_BACKEND() );
557 GetGitBackend()->Init();
558
559 if( !InitPgm( true ) )
560 return false;
561
562 m_bm.InitSettings( new KICAD_SETTINGS );
565 m_bm.Init();
566
568
569 return true;
570}
571
572
574{
575 argparse::ArgumentParser argParser( std::string( "kicad-cli" ), GetMajorMinorVersion().ToStdString(),
576 argparse::default_arguments::none );
577
578 argParser.add_argument( "-v", ARG_VERSION )
579 .help( UTF8STDSTR( _( "prints version information and exits" ) ) )
580 .flag()
581 .nargs( 0 );
582
583 argParser.add_argument( ARG_HELP_SHORT, ARG_HELP ).help( UTF8STDSTR( ARG_HELP_DESC ) ).flag().nargs( 0 );
584
585 for( COMMAND_ENTRY& entry : commandStack )
586 {
587 recurseArgParserBuild( argParser, entry );
588 }
589
590 try
591 {
592 // Use the C locale to parse arguments
593 // Otherwise the decimal separator for the locale will be applied
594 LOCALE_IO dummy;
595
596 // Pre-process arguments to handle negative vector values (e.g., --rotate -45,0,45)
597 // which argparse would otherwise interpret as unknown options
598 std::vector<std::string> args = preprocessArgs( m_argcUtf8, m_argvUtf8 );
599 argParser.parse_args( args );
600 }
601 // std::runtime_error doesn't seem to be enough for the scan<>()
602 catch( const std::exception& err )
603 {
604 bool requestedHelp = false;
605
606 for( int i = 0; i < m_argcUtf8; ++i )
607 {
608 if( std::string arg( m_argvUtf8[i] ); arg == ARG_HELP_SHORT || arg == ARG_HELP )
609 {
610 requestedHelp = true;
611 break;
612 }
613 }
614
615 if( !requestedHelp )
616 wxPrintf( "%s\n", err.what() );
617
618 // find the correct argparser object to output the command usage info
619 COMMAND_ENTRY* cliCmd = nullptr;
620 for( COMMAND_ENTRY& entry : commandStack )
621 {
622 if( argParser.is_subcommand_used( entry.handler->GetName() ) )
623 {
624 cliCmd = recurseArgParserSubCommandUsed( argParser, entry );
625 }
626 }
627
628 // arg parser uses a stream overload for printing the help
629 // we want to intercept so we can wxString the utf8 contents
630 // because on windows our terminal codepage might not be utf8
631 if( cliCmd )
632 cliCmd->handler->PrintHelp();
633 else
634 {
635 printHelp( argParser );
636 }
637
638 return requestedHelp ? 0 : CLI::EXIT_CODES::ERR_ARGS;
639 }
640
641 if( argParser[ARG_HELP] == true )
642 {
643 std::stringstream ss;
644 ss << argParser;
645 wxPrintf( From_UTF8( ss.str().c_str() ) );
646
647 return 0;
648 }
649
650 CLI::COMMAND* cliCmd = nullptr;
651
652 // the version arg gets redirected to the version subcommand
653 if( argParser[ARG_VERSION] == true )
654 {
655 cliCmd = &versionCmd;
656 }
657
658 if( !cliCmd )
659 {
660 for( COMMAND_ENTRY& entry : commandStack )
661 {
662 if( argParser.is_subcommand_used( entry.handler->GetName() ) )
663 {
664 COMMAND_ENTRY* cmdSubEntry = recurseArgParserSubCommandUsed( argParser, entry );
665 if( cmdSubEntry != nullptr )
666 {
667 cliCmd = cmdSubEntry->handler;
668 break;
669 }
670 }
671 }
672 }
673
674 if( cliCmd )
675 {
676 int exitCode = cliCmd->Perform( Kiway );
677
678 if( exitCode != CLI::EXIT_CODES::AVOID_CLOSING )
679 {
680 return exitCode;
681 }
682 else
683 {
684 return 0;
685 }
686 }
687 else
688 {
689 printHelp( argParser );
690
692 }
693}
694
695
697{
698 // Abort and wait on any background jobs, if InitPgm() got far enough to start the pool
699 if( m_singleton.m_ThreadPool )
700 {
701 GetKiCadThreadPool().purge();
702 GetKiCadThreadPool().wait();
703 }
704
706 {
707 if( KIFACE* kiface = Kiway.KiFACE( face, false ) )
708 kiface->Reset();
709 }
710
712 {
714 m_settings_manager->Save();
715
716 // Unload projects while the kiface DRC/ERC severity tables their PROJECT_FILE serializes
717 // against are still alive; deferring to static teardown crashes
718 for( const wxString& projectPath : m_settings_manager->GetOpenProjects() )
719 {
720 if( PROJECT* project = m_settings_manager->GetProject( projectPath ) )
721 m_settings_manager->UnloadProject( project, false );
722 }
723 }
724
726
727 // Release module settings while the settings manager is still available.
728 Destroy();
729
730 m_settings_manager.reset();
731
732 if( GetGitBackend() )
733 {
735 delete GetGitBackend();
736 SetGitBackend( nullptr );
737 }
738
739}
740
741
742void PGM_KICAD::MacOpenFile( const wxString& aFileName )
743{
744#if defined( __WXMAC__ )
745 wxFAIL_MSG( "kicad-cli should not call MacOpenFile" );
746#endif
747}
748
749
751{
752 // unlike a normal destructor, this is designed to be called more
753 // than once safely:
754
755 m_bm.End();
756
758}
759
760
762
764
768struct APP_KICAD_CLI : public wxAppConsole
769{
771 wxAppConsole()
772 {
773 SetPgm( &program );
774
775 // Init the environment each platform wants
777 }
778
779
780 bool OnInit() override
781 {
782 // Perform platform-specific init tasks
783 if( !KIPLATFORM::APP::Init() )
784 return false;
785
786#ifndef DEBUG
787 // Enable logging traces to the console in release build.
788 // This is usually disabled, but it can be useful for users to run to help
789 // debug issues and other problems.
790 if( wxGetEnv( wxS( "KICAD_ENABLE_WXTRACE" ), nullptr ) )
791 {
792 wxLog::EnableLogging( true );
793 wxLog::SetLogLevel( wxLOG_Trace );
794 }
795#endif
796
797 // An escaping exception would skip OnPgmExit() and crash the static teardown
798 try
799 {
800 if( program.OnPgmInit() )
801 return true;
802 }
803 catch( ... )
804 {
805 Pgm().HandleException( std::current_exception() );
806 }
807
808 program.OnPgmExit();
809 return false;
810 }
811
812 int OnExit() override
813 {
814 // Drain any pending wx-managed objects before tearing down PGM_BASE
815 // singletons so destructors can still call into Pgm(). See
816 // https://gitlab.com/kicad/code/kicad/-/issues/23373 for the GUI variant
817 // of this hazard; kept consistent with the GUI apps for parity.
818 int ret = wxAppConsole::OnExit();
819
820#if defined( __FreeBSD__ )
821 // Avoid wxLog crashing when used in destructors invoked from OnPgmExit().
822 wxLog::EnableLogging( false );
823#endif
824
825 program.OnPgmExit();
826 program.ExitIfTeardownUnsafe();
827
828 return ret;
829 }
830
831 int OnRun() override
832 {
833 int ret = -1;
834
835 try
836 {
837 ret = program.OnPgmRun();
838 }
839 catch( ... )
840 {
841 Pgm().HandleException( std::current_exception() );
842 }
843
844 program.SetRunResult( ret );
845
846 return ret;
847 }
848
849 int FilterEvent( wxEvent& aEvent ) override { return Event_Skip; }
850
851#if defined( DEBUG )
855 bool ProcessEvent( wxEvent& aEvent ) override
856 {
857 if( aEvent.GetEventType() == wxEVT_CHAR || aEvent.GetEventType() == wxEVT_CHAR_HOOK )
858 {
859 wxKeyEvent* keyEvent = static_cast<wxKeyEvent*>( &aEvent );
860
861 if( keyEvent )
862 {
863 wxLogTrace( kicadTraceKeyEvent, "APP_KICAD_CLI::ProcessEvent %s", dump( *keyEvent ) );
864 }
865 }
866
867 return wxAppConsole::ProcessEvent( aEvent );
868 }
869
877 bool OnExceptionInMainLoop() override
878 {
879 try
880 {
881 throw;
882 }
883 catch( ... )
884 {
885 Pgm().HandleException( std::current_exception() );
886 }
887
888 return false; // continue on. Return false to abort program
889 }
890#endif
891};
892
893IMPLEMENT_APP_CONSOLE( APP_KICAD_CLI )
894
895
896// The C++ project manager supports one open PROJECT, so Prj() calls within
897// this link image need this function.
899{
900 return Kiway.Prj();
901}
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:48
int Perform(KIWAY &aKiway)
Entry point to processing commands from args and doing work.
Definition command.cpp:56
Batch (non-interactive) git merge-driver hook for KiCad documents/libraries.
Top-level kicad-cli import command.
kicad-cli mergetool ANCESTOR OURS THEIRS -o OUTPUT — uniform entry point for git mergetool.
virtual void Shutdown()=0
virtual void Init()=0
A KIFACE implementation.
Definition kiface_base.h:35
virtual void Reset() override
Reloads global state.
Definition kiface_base.h:51
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:348
virtual KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Return the KIFACE* given a FACE_T.
Definition kiway.cpp:216
FACE_T
Known KIFACE implementations.
Definition kiway.h:354
@ FACE_SCH
eeschema DSO
Definition kiway.h:355
@ FACE_PCB
pcbnew DSO
Definition kiway.h:356
void OnKiwayEnd()
Definition kiway.cpp:841
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:236
int m_argcUtf8
Definition pgm_base.h:478
std::unique_ptr< SETTINGS_MANAGER > m_settings_manager
Definition pgm_base.h:442
void Destroy()
Definition pgm_base.cpp:190
char ** m_argvUtf8
argv parameters converted to utf8 form because wxWidgets has opinions.
Definition pgm_base.h:476
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:861
void BuildArgvUtf8()
Builds the UTF8 based argv variable.
Definition pgm_base.cpp:307
bool InitPgm(bool aHeadless=false, bool aIsUnitTest=false)
Initialize this program.
Definition pgm_base.cpp:373
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition pgm_base.h:124
virtual LIBRARY_MANAGER & GetLibraryManager() const
Definition pgm_base.h:126
void SaveCommonSettings()
Save the program (process) settings subset which are stored .kicad_common.
Definition pgm_base.cpp:591
KICAD_SINGLETON m_singleton
Definition pgm_base.h:463
PGM_KICAD extends PGM_BASE to bring in FileHistory() and PdfBrowser() which were moved from EDA_APP i...
Definition pgm_kicad.h:37
bool OnPgmInit()
Definition kicad.cpp:102
void Destroy()
Definition kicad.cpp:544
void MacOpenFile(const wxString &aFileName) override
Specific to MacOSX (not used under Linux or Windows).
Definition kicad.cpp:531
void OnPgmExit()
Definition kicad.cpp:495
APP_SETTINGS_BASE * PgmSettings()
Definition pgm_kicad.h:54
int OnPgmRun()
Definition kicad.cpp:489
BIN_MOD m_bm
Definition pgm_kicad.h:67
Container for project specific data.
Definition project.h:63
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
static std::string ToStdString(const wxString &aStr)
#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:730
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::MERGETOOL_COMMAND mergetoolCmd
static CLI::PCB_EXPORT_STATS_COMMAND exportPcbStatsCmd
static CLI::GIT_MERGEDRIVER_COMMAND gitMergeDriverCmd
static CLI::PCB_EXPORT_DXF_COMMAND exportPcbDxfCmd
static CLI::SCH_ERC_COMMAND schErcCmd
static CLI::SCH_DOWNGRADE_COMMAND schDowngradeCmd
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::SCH_DIFF_COMMAND schDiffCmd
static CLI::SYM_UPGRADE_COMMAND symUpgradeCmd
static CLI::FP_EXPORT_COMMAND fpExportCmd
static CLI::SCH_EXPORT_PYTHONBOM_COMMAND exportSchPythonBomCmd
static CLI::PROJECT_DOWNGRADE_COMMAND projectDowngradeCmd
static CLI::PCB_DOWNGRADE_COMMAND pcbDowngradeCmd
static CLI::FP_UPGRADE_COMMAND fpUpgradeCmd
static CLI::EXPORT_BOM_COMMAND exportSchBomCmd
static CLI::SCH_EXPORT_PLOT_COMMAND exportSchPdfCmd
static void printHelp(argparse::ArgumentParser &argParser)
static CLI::PCB_EXPORT_SPECCTRA_COMMAND exportPcbSpecctraCmd
static CLI::JOBSET_RUN_COMMAND jobsetRunCmd
static CLI::PCB_DIFF_COMMAND pcbDiffCmd
static CLI::PCB_UPGRADE_COMMAND pcbUpgradeCmd
static CLI::PCB_EXPORT_POS_COMMAND exportPcbPosCmd
static CLI::PROJECT_COMMAND projectCmd
static CLI::GERBER_DIFF_COMMAND gerberDiffCmd
static CLI::PCB_EXPORT_PS_COMMAND exportPcbPsCmd
static CLI::GERBER_COMMAND gerberCmd
static CLI::IMPORT_COMMAND importCmd
static CLI::FP_DIFF_COMMAND fpDiffCmd
static CLI::SYM_COMMAND symCmd
static CLI::SCH_IMPORT_COMMAND schImportCmd
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::GERBER_CONVERT_PNG_COMMAND gerberConvertPngCmd
static CLI::PCB_EXPORT_IPCD356_COMMAND exportPcbIpcD356Cmd
static CLI::EXPORT_BOM_COMMAND exportPcbBomCmd
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::PCB_EXPORT_IDF_COMMAND exportPcbIdfCmd
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::FP_DOWNGRADE_COMMAND fpDowngradeCmd
static CLI::SYM_DOWNGRADE_COMMAND symDowngradeCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcbU3DCmd
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static CLI::SYM_DIFF_COMMAND symDiffCmd
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::PCB_EXPORT_STACKUP_COMMAND exportPcbStackupCmd
static CLI::SCH_UPGRADE_COMMAND schUpgradeCmd
static CLI::PCB_EXPORT_3D_COMMAND exportPcbXaoCmd
static void recurseArgParserBuild(argparse::ArgumentParser &aArgParser, COMMAND_ENTRY &aEntry)
static CLI::API_SERVER_COMMAND apiServerCmd
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:175
#define KFCTL_CLI
Running as CLI app.
Definition kiway.h:176
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:46
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:120
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.
IFACE KIFACE_BASE kiface("pcb_test_frame", KIWAY::FACE_PCB)
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.