Class: SvgConform::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/svg_conform/cli.rb

Overview

Thor-based CLI for SvgConform with svgcheck-like functionality

Class Method Summary collapse

Instance Method Summary collapse

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

Returns:

  • (Boolean)


21
22
23
# File 'lib/svg_conform/cli.rb', line 21

def self.check_unknown_options?(*)
  true
end

.exit_on_failure?Boolean

Exit with non-zero status when a command raises an error

Returns:

  • (Boolean)


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?")

Returns:

  • (Boolean)


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, options).execute
end

#profilesObject



104
105
106
# File 'lib/svg_conform/cli.rb', line 104

def profiles
  SvgConform::Commands::Profiles.new(options).execute
end

#versionObject



109
110
111
# File 'lib/svg_conform/cli.rb', line 109

def version
  puts "SvgConform #{SvgConform::VERSION}"
end