Class: SvgConform::Cli
- Inherits:
-
Thor
- Object
- Thor
- SvgConform::Cli
- Defined in:
- lib/svg_conform/cli.rb
Overview
Thor-based CLI for SvgConform with svgcheck-like functionality
Class Method Summary collapse
-
.check_unknown_options? ⇒ Boolean
Use strict mode to catch unknown options at parse time rather than runtime.
-
.exit_on_failure? ⇒ Boolean
Exit with non-zero status when a command raises an error.
-
.handle_unknown_command? ⇒ Boolean
Let Thor handle unknown commands - it raises Thor::UndefinedCommandError which provides helpful suggestions (e.g., "Did you mean?").
Instance Method Summary collapse
- #check(*files) ⇒ Object
-
#initialize(*args) ⇒ Cli
constructor
A new instance of Cli.
- #profiles ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(*args) ⇒ Cli
Returns a new instance of Cli.
25 26 27 |
# File 'lib/svg_conform/cli.rb', line 25 def initialize(*args) super end |
Class Method Details
.check_unknown_options? ⇒ Boolean
Use strict mode to catch unknown options at parse time rather than runtime
21 22 23 |
# File 'lib/svg_conform/cli.rb', line 21 def self.(*) true end |
.exit_on_failure? ⇒ Boolean
Exit with non-zero status when a command raises an error
16 17 18 |
# File 'lib/svg_conform/cli.rb', line 16 def self.exit_on_failure? true end |
.handle_unknown_command? ⇒ Boolean
Let Thor handle unknown commands - it raises Thor::UndefinedCommandError which provides helpful suggestions (e.g., "Did you mean?")
115 116 117 |
# File 'lib/svg_conform/cli.rb', line 115 def self.handle_unknown_command?(*) false end |
Instance Method Details
#check(*files) ⇒ Object
85 86 87 |
# File 'lib/svg_conform/cli.rb', line 85 def check(*files) SvgConform::Commands::Check.new(files, ).execute end |
#profiles ⇒ Object
104 105 106 |
# File 'lib/svg_conform/cli.rb', line 104 def profiles SvgConform::Commands::Profiles.new().execute end |
#version ⇒ Object
109 110 111 |
# File 'lib/svg_conform/cli.rb', line 109 def version puts "SvgConform #{SvgConform::VERSION}" end |