From 5136ec07cf2cada9453a1b7e3673e258c2b0c526 Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Tue, 22 Aug 2023 13:42:16 +0000 Subject: [PATCH] Add more cli command descriptions --- kicad/cli/command_fp.h | 4 +++- kicad/cli/command_fp_export_svg.cpp | 2 ++ kicad/cli/command_fp_upgrade.cpp | 4 +++- kicad/cli/command_pcb.h | 4 +++- kicad/cli/command_pcb_drc.cpp | 2 ++ kicad/cli/command_sch.h | 4 +++- kicad/cli/command_sch_erc.cpp | 10 ++++++---- kicad/cli/command_sym.h | 4 +++- kicad/cli/command_sym_export_svg.cpp | 2 ++ kicad/cli/command_sym_upgrade.cpp | 4 +++- kicad/cli/command_version.cpp | 2 ++ 11 files changed, 32 insertions(+), 10 deletions(-) diff --git a/kicad/cli/command_fp.h b/kicad/cli/command_fp.h index 013d3ef81d..a0b58f735c 100644 --- a/kicad/cli/command_fp.h +++ b/kicad/cli/command_fp.h @@ -27,7 +27,9 @@ namespace CLI { struct FP_COMMAND : public COMMAND { - FP_COMMAND() : COMMAND( "fp" ) {} + FP_COMMAND() : COMMAND( "fp" ) { + m_argParser.add_description( UTF8STDSTR( _( "Footprint and Footprint Libraries" ) ) ); + } }; } diff --git a/kicad/cli/command_fp_export_svg.cpp b/kicad/cli/command_fp_export_svg.cpp index e62b978561..77e1ee92a5 100644 --- a/kicad/cli/command_fp_export_svg.cpp +++ b/kicad/cli/command_fp_export_svg.cpp @@ -33,6 +33,8 @@ 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 ); m_argParser.add_argument( "-t", ARG_THEME ) diff --git a/kicad/cli/command_fp_upgrade.cpp b/kicad/cli/command_fp_upgrade.cpp index 2030ecaa7f..6b41b9537e 100644 --- a/kicad/cli/command_fp_upgrade.cpp +++ b/kicad/cli/command_fp_upgrade.cpp @@ -32,6 +32,8 @@ 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 ) .help( UTF8STDSTR( _( "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 ) ) { - 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; } diff --git a/kicad/cli/command_pcb.h b/kicad/cli/command_pcb.h index 78ec3303d5..daadc400bc 100644 --- a/kicad/cli/command_pcb.h +++ b/kicad/cli/command_pcb.h @@ -27,7 +27,9 @@ namespace CLI { struct PCB_COMMAND : public COMMAND { - PCB_COMMAND() : COMMAND( "pcb" ) {} + PCB_COMMAND() : COMMAND( "pcb" ) { + m_argParser.add_description( UTF8STDSTR( _( "PCB" ) ) ); + } }; } diff --git a/kicad/cli/command_pcb_drc.cpp b/kicad/cli/command_pcb_drc.cpp index 855dbd8db0..d34453569a 100644 --- a/kicad/cli/command_pcb_drc.cpp +++ b/kicad/cli/command_pcb_drc.cpp @@ -39,6 +39,8 @@ 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 ) .default_value( std::string( "report" ) ) .help( UTF8STDSTR( _( "Output file format, options: json, report" ) ) ); diff --git a/kicad/cli/command_sch.h b/kicad/cli/command_sch.h index 8b16f62627..3abd2564d9 100644 --- a/kicad/cli/command_sch.h +++ b/kicad/cli/command_sch.h @@ -27,7 +27,9 @@ namespace CLI { struct SCH_COMMAND : public COMMAND { - SCH_COMMAND() : COMMAND( "sch" ) { } + SCH_COMMAND() : COMMAND( "sch" ) { + m_argParser.add_description( UTF8STDSTR( _( "Schematics" ) ) ); + } }; } diff --git a/kicad/cli/command_sch_erc.cpp b/kicad/cli/command_sch_erc.cpp index 35a22b373e..6aace29d60 100644 --- a/kicad/cli/command_sch_erc.cpp +++ b/kicad/cli/command_sch_erc.cpp @@ -38,6 +38,8 @@ 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 ) .default_value( std::string( "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" ) ) ); 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 ) .default_value( false ); 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 ) .default_value( false ); 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 ) .default_value( false ); 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 ) .default_value( false ); diff --git a/kicad/cli/command_sym.h b/kicad/cli/command_sym.h index 0ff86004a4..4347c45616 100644 --- a/kicad/cli/command_sym.h +++ b/kicad/cli/command_sym.h @@ -27,7 +27,9 @@ namespace CLI { struct SYM_COMMAND : public COMMAND { - SYM_COMMAND() : COMMAND( "sym" ) {} + SYM_COMMAND() : COMMAND( "sym" ) { + m_argParser.add_description( UTF8STDSTR( _( "Symbol and Symbol Libraries" ) ) ); + } }; } diff --git a/kicad/cli/command_sym_export_svg.cpp b/kicad/cli/command_sym_export_svg.cpp index 092c22b3d8..e47a17cf7c 100644 --- a/kicad/cli/command_sym_export_svg.cpp +++ b/kicad/cli/command_sym_export_svg.cpp @@ -35,6 +35,8 @@ 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 ) .default_value( std::string() ) .help( UTF8STDSTR( _( "Color theme to use (will default to pcbnew settings)" ) ) ); diff --git a/kicad/cli/command_sym_upgrade.cpp b/kicad/cli/command_sym_upgrade.cpp index d988a6e22d..55c32a3b69 100644 --- a/kicad/cli/command_sym_upgrade.cpp +++ b/kicad/cli/command_sym_upgrade.cpp @@ -32,6 +32,8 @@ 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 ) .help( UTF8STDSTR( _( "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 ) ) { - 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; } diff --git a/kicad/cli/command_version.cpp b/kicad/cli/command_version.cpp index 00b02e305e..0a177048ad 100644 --- a/kicad/cli/command_version.cpp +++ b/kicad/cli/command_version.cpp @@ -30,6 +30,8 @@ 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 ) .default_value( std::string( "plain" ) ) .help( UTF8STDSTR( _( "version info format (plain, commit, about)" ) ) );