Class: Sutty::Cli::CLI

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

Overview

Handle the application command line parsing and the dispatch to various command objects

Constant Summary collapse

Error =

Error raised by this runner

Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#container(name) ⇒ Object



73
74
75
76
77
78
79
80
# File 'lib/sutty/cli/cli.rb', line 73

def container(name)
  if options[:help]
    invoke :help, ['container']
  else
    require_relative 'commands/container'
    Sutty::Cli::Commands::Container.new(name, options).execute
  end
end

#field(name) ⇒ Object



137
138
139
140
141
142
143
# File 'lib/sutty/cli/cli.rb', line 137

def field(name)
  if options[:help]
    invoke :help, ['field']
  else
    Sutty::Cli::Commands::Field.new(name, options).execute
  end
end

#layout(name) ⇒ Object



148
149
150
151
152
153
154
# File 'lib/sutty/cli/cli.rb', line 148

def layout(name)
  if options[:help]
    invoke :help, ['layout']
  else
    Sutty::Cli::Commands::Layout.new(name, options).execute
  end
end

#postObject



61
62
63
64
65
66
67
68
# File 'lib/sutty/cli/cli.rb', line 61

def post
  if options[:help]
    invoke :help, ['post']
  else
    require_relative 'commands/post'
    Sutty::Cli::Commands::Post.new(options).execute
  end
end

#theme(name) ⇒ Object



159
160
161
162
163
164
165
166
# File 'lib/sutty/cli/cli.rb', line 159

def theme(name)
  if options[:help]
    invoke :help, ['theme']
  else
    require_relative 'commands/theme'
    Sutty::Cli::Commands::Theme.new(name, options).execute
  end
end

#versionObject



19
20
21
22
# File 'lib/sutty/cli/cli.rb', line 19

def version
  require_relative 'version'
  puts "v#{Sutty::Cli::VERSION}"
end