Add more cli command descriptions

This commit is contained in:
Mark Roszko 2023-08-22 13:42:16 +00:00
parent b59f7fbd9d
commit 5136ec07cf
11 changed files with 32 additions and 10 deletions

View File

@ -27,7 +27,9 @@ namespace CLI
{ {
struct FP_COMMAND : public COMMAND struct FP_COMMAND : public COMMAND
{ {
FP_COMMAND() : COMMAND( "fp" ) {} FP_COMMAND() : COMMAND( "fp" ) {
m_argParser.add_description( UTF8STDSTR( _( "Footprint and Footprint Libraries" ) ) );
}
}; };
} }

View File

@ -33,6 +33,8 @@
CLI::FP_EXPORT_SVG_COMMAND::FP_EXPORT_SVG_COMMAND() : PCB_EXPORT_BASE_COMMAND( "svg" ) CLI::FP_EXPORT_SVG_COMMAND::FP_EXPORT_SVG_COMMAND() : PCB_EXPORT_BASE_COMMAND( "svg" )
{ {
m_argParser.add_description( UTF8STDSTR( _( "Exports the footprint or entire footprint library to SVG" ) ) );
addLayerArg( false ); addLayerArg( false );
m_argParser.add_argument( "-t", ARG_THEME ) m_argParser.add_argument( "-t", ARG_THEME )

View File

@ -32,6 +32,8 @@
CLI::FP_UPGRADE_COMMAND::FP_UPGRADE_COMMAND() : PCB_EXPORT_BASE_COMMAND( "upgrade" ) CLI::FP_UPGRADE_COMMAND::FP_UPGRADE_COMMAND() : PCB_EXPORT_BASE_COMMAND( "upgrade" )
{ {
m_argParser.add_description( UTF8STDSTR( _( "Upgrades the footprint library to the current kicad version format" ) ) );
m_argParser.add_argument( ARG_FORCE ) m_argParser.add_argument( ARG_FORCE )
.help( UTF8STDSTR( .help( UTF8STDSTR(
_( "Forces the footprint library to be resaved regardless of versioning" ) ) ) _( "Forces the footprint library to be resaved regardless of versioning" ) ) )
@ -50,7 +52,7 @@ int CLI::FP_UPGRADE_COMMAND::doPerform( KIWAY& aKiway )
if( !wxDir::Exists( fpJob->m_libraryPath ) ) if( !wxDir::Exists( fpJob->m_libraryPath ) )
{ {
wxFprintf( stderr, _( "Footprint path does not exist or is not accessible\n" ) ); wxFprintf( stderr, _( "Footprint library path does not exist or is not accessible\n" ) );
return EXIT_CODES::ERR_INVALID_INPUT_FILE; return EXIT_CODES::ERR_INVALID_INPUT_FILE;
} }

View File

@ -27,7 +27,9 @@ namespace CLI
{ {
struct PCB_COMMAND : public COMMAND struct PCB_COMMAND : public COMMAND
{ {
PCB_COMMAND() : COMMAND( "pcb" ) {} PCB_COMMAND() : COMMAND( "pcb" ) {
m_argParser.add_description( UTF8STDSTR( _( "PCB" ) ) );
}
}; };
} }

View File

@ -39,6 +39,8 @@
CLI::PCB_DRC_COMMAND::PCB_DRC_COMMAND() : PCB_EXPORT_BASE_COMMAND( "drc" ) CLI::PCB_DRC_COMMAND::PCB_DRC_COMMAND() : PCB_EXPORT_BASE_COMMAND( "drc" )
{ {
m_argParser.add_description( UTF8STDSTR( _( "Runs the Design Rules Check (DRC) on the PCB and creates a report" ) ) );
m_argParser.add_argument( ARG_FORMAT ) m_argParser.add_argument( ARG_FORMAT )
.default_value( std::string( "report" ) ) .default_value( std::string( "report" ) )
.help( UTF8STDSTR( _( "Output file format, options: json, report" ) ) ); .help( UTF8STDSTR( _( "Output file format, options: json, report" ) ) );

View File

@ -27,7 +27,9 @@ namespace CLI
{ {
struct SCH_COMMAND : public COMMAND struct SCH_COMMAND : public COMMAND
{ {
SCH_COMMAND() : COMMAND( "sch" ) { } SCH_COMMAND() : COMMAND( "sch" ) {
m_argParser.add_description( UTF8STDSTR( _( "Schematics" ) ) );
}
}; };
} }

View File

@ -38,6 +38,8 @@
CLI::SCH_ERC_COMMAND::SCH_ERC_COMMAND() : PCB_EXPORT_BASE_COMMAND( "erc" ) CLI::SCH_ERC_COMMAND::SCH_ERC_COMMAND() : PCB_EXPORT_BASE_COMMAND( "erc" )
{ {
m_argParser.add_description( UTF8STDSTR( _( "Runs the Electrical Rules Check (ERC) on the schematic and creates a report" ) ) );
m_argParser.add_argument( ARG_FORMAT ) m_argParser.add_argument( ARG_FORMAT )
.default_value( std::string( "report" ) ) .default_value( std::string( "report" ) )
.help( UTF8STDSTR( _( "Output file format, options: json, report" ) ) ); .help( UTF8STDSTR( _( "Output file format, options: json, report" ) ) );
@ -48,22 +50,22 @@ CLI::SCH_ERC_COMMAND::SCH_ERC_COMMAND() : PCB_EXPORT_BASE_COMMAND( "erc" )
_( "Report units; valid options: in, mm, mils" ) ) ); _( "Report units; valid options: in, mm, mils" ) ) );
m_argParser.add_argument( ARG_SEVERITY_ALL ) m_argParser.add_argument( ARG_SEVERITY_ALL )
.help( UTF8STDSTR( _( "Report all DRC violations, this is equivalent to including all the other severity arguments" ) ) ) .help( UTF8STDSTR( _( "Report all ERC violations, this is equivalent to including all the other severity arguments" ) ) )
.implicit_value( true ) .implicit_value( true )
.default_value( false ); .default_value( false );
m_argParser.add_argument( ARG_SEVERITY_ERROR ) m_argParser.add_argument( ARG_SEVERITY_ERROR )
.help( UTF8STDSTR( _( "Report all DRC error level violations, this can be combined with the other severity arguments" ) ) ) .help( UTF8STDSTR( _( "Report all ERC error level violations, this can be combined with the other severity arguments" ) ) )
.implicit_value( true ) .implicit_value( true )
.default_value( false ); .default_value( false );
m_argParser.add_argument( ARG_SEVERITY_WARNING ) m_argParser.add_argument( ARG_SEVERITY_WARNING )
.help( UTF8STDSTR( _( "Report all DRC warning level violations, this can be combined with the other severity arguments" ) ) ) .help( UTF8STDSTR( _( "Report all ERC warning level violations, this can be combined with the other severity arguments" ) ) )
.implicit_value( true ) .implicit_value( true )
.default_value( false ); .default_value( false );
m_argParser.add_argument( ARG_SEVERITY_EXCLUSIONS ) m_argParser.add_argument( ARG_SEVERITY_EXCLUSIONS )
.help( UTF8STDSTR( _( "Report all excluded DRC violations, this can be combined with the other severity arguments" ) ) ) .help( UTF8STDSTR( _( "Report all excluded ERC violations, this can be combined with the other severity arguments" ) ) )
.implicit_value( true ) .implicit_value( true )
.default_value( false ); .default_value( false );

View File

@ -27,7 +27,9 @@ namespace CLI
{ {
struct SYM_COMMAND : public COMMAND struct SYM_COMMAND : public COMMAND
{ {
SYM_COMMAND() : COMMAND( "sym" ) {} SYM_COMMAND() : COMMAND( "sym" ) {
m_argParser.add_description( UTF8STDSTR( _( "Symbol and Symbol Libraries" ) ) );
}
}; };
} }

View File

@ -35,6 +35,8 @@
CLI::SYM_EXPORT_SVG_COMMAND::SYM_EXPORT_SVG_COMMAND() : PCB_EXPORT_BASE_COMMAND( "svg" ) CLI::SYM_EXPORT_SVG_COMMAND::SYM_EXPORT_SVG_COMMAND() : PCB_EXPORT_BASE_COMMAND( "svg" )
{ {
m_argParser.add_description( UTF8STDSTR( _( "Exports the symbol or entire symbol library to SVG" ) ) );
m_argParser.add_argument( "-t", ARG_THEME ) m_argParser.add_argument( "-t", ARG_THEME )
.default_value( std::string() ) .default_value( std::string() )
.help( UTF8STDSTR( _( "Color theme to use (will default to pcbnew settings)" ) ) ); .help( UTF8STDSTR( _( "Color theme to use (will default to pcbnew settings)" ) ) );

View File

@ -32,6 +32,8 @@
CLI::SYM_UPGRADE_COMMAND::SYM_UPGRADE_COMMAND() : PCB_EXPORT_BASE_COMMAND( "upgrade" ) CLI::SYM_UPGRADE_COMMAND::SYM_UPGRADE_COMMAND() : PCB_EXPORT_BASE_COMMAND( "upgrade" )
{ {
m_argParser.add_description( UTF8STDSTR( _( "Upgrades the symbol library to the current kicad version format" ) ) );
m_argParser.add_argument( ARG_FORCE ) m_argParser.add_argument( ARG_FORCE )
.help( UTF8STDSTR( .help( UTF8STDSTR(
_( "Forces the symbol library to be resaved regardless of versioning" ) ) ) _( "Forces the symbol library to be resaved regardless of versioning" ) ) )
@ -50,7 +52,7 @@ int CLI::SYM_UPGRADE_COMMAND::doPerform( KIWAY& aKiway )
if( !wxFile::Exists( symJob->m_libraryPath ) ) if( !wxFile::Exists( symJob->m_libraryPath ) )
{ {
wxFprintf( stderr, _( "Symbol file does not exist or is not accessible\n" ) ); wxFprintf( stderr, _( "Symbol library does not exist or is not accessible\n" ) );
return EXIT_CODES::ERR_INVALID_INPUT_FILE; return EXIT_CODES::ERR_INVALID_INPUT_FILE;
} }

View File

@ -30,6 +30,8 @@
CLI::VERSION_COMMAND::VERSION_COMMAND() : COMMAND( "version" ) CLI::VERSION_COMMAND::VERSION_COMMAND() : COMMAND( "version" )
{ {
m_argParser.add_description( UTF8STDSTR( _( "Reports the version info in various formats" ) ) );
m_argParser.add_argument( ARG_FORMAT ) m_argParser.add_argument( ARG_FORMAT )
.default_value( std::string( "plain" ) ) .default_value( std::string( "plain" ) )
.help( UTF8STDSTR( _( "version info format (plain, commit, about)" ) ) ); .help( UTF8STDSTR( _( "version info format (plain, commit, about)" ) ) );