34#include <wx/filename.h>
38#define ARG_ANCESTOR "ancestor"
39#define ARG_OURS "ours"
40#define ARG_THEIRS "theirs"
41#define ARG_OUTPUT_F "--output"
57 default:
return aKicadExit;
82 UTF8STDSTR(
_(
"Three-way merge driver for `git mergetool`. Detects PCB vs "
83 "schematic vs library item from the output extension, opens "
84 "the resolution dialog in the GUI kicad binary for any "
85 "unresolved conflicts where available, "
86 "and writes the merged file." ) ) );
90 ".kicad_sym, or .kicad_mod)" ) ) )
91 .metavar(
"ANCESTOR" );
103 .
help(
UTF8STDSTR(
_(
"Output path; extension picks the document type" ) ) )
117 wxFprintf( stderr,
_(
"--output is required\n" ) );
126 _(
"Unsupported output extension '%s'. "
127 "Expected .kicad_pcb, .kicad_sch, .kicad_sym, or .kicad_mod\n" ),
138 if( kicadBinPath.IsEmpty() )
141 _(
"Cannot find the main kicad binary alongside kicad-cli.\n" ) );
149 const wxScopedCharBuffer args[] = {
150 kicadBinPath.utf8_str(),
151 wxScopedCharBuffer::CreateNonOwned(
"--mergetool" ),
158 const char* argv[] = { args[0].data(), args[1].data(), args[2].data(),
159 args[3].data(), args[4].data(), args[5].data(),
162 const long rc = wxExecute(
const_cast<char**
>( argv ), wxEXEC_SYNC );
166 wxFprintf( stderr,
_(
"Failed to launch '%s'\n" ), kicadBinPath );
argparse::ArgumentParser m_argParser
COMMAND(const std::string &aName)
Define a new COMMAND instance.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
static wxString ResolveSiblingExecutable(const wxString &aBaseName)
Resolve a sibling executable alongside the running process.
static const int ERR_ARGS
static const int ERR_RC_VIOLATIONS
Rules check violation count was greater than 0.
static const int ERR_INVALID_INPUT_FILE
static const int ERR_INVALID_OUTPUT_CONFLICT
DOC_KIND DocKindFromExtension(const wxString &aPath)
Map a path's extension to a DOC_KIND (.kicad_pcb -> PCB, .kicad_sch -> SCH, .kicad_sym -> SYM_LIB,...
DOC_KIND
Document type a diff/merge entry point should route to, derived from a file path's extension.
wxString From_UTF8(const char *cstring)