Class: Mddb::CLI

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

Class Method Summary collapse

Class Method Details

.runObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/mddb/cli.rb', line 4

def self.run
  if ARGV.empty? 
    puts "Using MDDB v." + Mddb::VERSION
    puts "Options:"
    puts "  new                 Creates a new project"
    puts "  generate <model>    Creates a new model." 
    puts "                      Leave blank for list of available "
    puts "                      models"
    puts "  console             Starts an interactice MDDB console"
    puts "  run                 Run calculation"
  elsif %w{-v --version --v}.include? ARGV.first
    puts Mddb::VERSION
  elsif ARGV.first == 'new'
    ARGV.shift
    require 'mddb/commands/new'
  elsif ARGV.first == 'console'
    require 'mddb/commands/console'
  elsif ARGV.first == 'run'
    require 'mddb/commands/run'
  elsif ARGV.first == 'load'
    require 'mddb/commands/load'
  elsif  %w{g generate}.include? ARGV.first
    ARGV.shift
    require 'mddb/generators'
  end
end