27#include <wx/filename.h>
30#define ARG_FILE_A "file1"
31#define ARG_FILE_B "file2"
32#define ARG_FORMAT "--format"
33#define ARG_DPI "--dpi"
34#define ARG_NO_ANTIALIAS "--no-antialias"
35#define ARG_TRANSPARENT "--transparent"
36#define ARG_EXIT_CODE_ONLY "--exit-code-only"
37#define ARG_TOLERANCE "--tolerance"
38#define ARG_STRICT "--strict"
39#define ARG_NO_ALIGN "--no-align"
47 m_argParser.add_description(
UTF8STDSTR(
_(
"Compare two Gerber or Excellon files and show differences" ) ) );
50 .help(
UTF8STDSTR(
_(
"Reference file (first Gerber/Excellon file)" ) ) )
54 .help(
UTF8STDSTR(
_(
"Comparison file (second Gerber/Excellon file)" ) ) )
58 .default_value( std::string(
"png" ) )
59 .help(
UTF8STDSTR(
_(
"Output format: png, text, or json (default: png)" ) ) )
65 .
help(
UTF8STDSTR(
_(
"Resolution in DPI for PNG output (default: 300)" ) ) )
69 .help(
UTF8STDSTR(
_(
"Disable anti-aliasing for PNG output" ) ) )
73 .help(
UTF8STDSTR(
_(
"Use transparent background for PNG output" ) ) )
77 .help(
UTF8STDSTR(
_(
"Only set exit code (0=identical, 1=different), no output" ) ) )
83 .
help(
UTF8STDSTR(
_(
"Tolerance in nm for floating point comparisons (default: 0)" ) ) )
84 .metavar(
"TOLERANCE" );
89 .help(
UTF8STDSTR(
_(
"Skip bounding-box origin alignment; catches absolute-placement regressions" ) ) )
96 std::unique_ptr<JOB_GERBER_DIFF> diffJob = std::make_unique<JOB_GERBER_DIFF>();
110 if( format == wxS(
"png" ) )
114 else if( format == wxS(
"text" ) )
118 else if( format == wxS(
"json" ) )
124 wxFprintf( stderr,
_(
"Invalid output format: %s\n" ), format );
134 wxFileName inputFn( diffJob->m_inputFileA );
135 diffJob->SetConfiguredOutputPath( inputFn.GetPath() + wxFileName::GetPathSeparator() + inputFn.GetName()
136 + wxS(
"-diff.png" ) );
argparse::ArgumentParser m_argParser
COMMAND(const std::string &aName)
Define a new COMMAND instance.
void addCommonArgs(bool aInput, bool aOutput, IO_TYPE aInputType, IO_TYPE aOutputType)
Set up the most common of args used across cli.
wxString m_argOutput
Value of the output arg if configured.
int doPerform(KIWAY &aKiway) override
The internal handler that should be overloaded to implement command specific processing and work.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
int ProcessJob(KIWAY::FACE_T aFace, JOB *aJob, REPORTER *aReporter=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
#define ARG_EXIT_CODE_ONLY
This file contains miscellaneous commonly used macros and functions.
static const int ERR_ARGS
wxString From_UTF8(const char *cstring)