Class: Mono::Tool

Inherits:
Object
  • Object
show all
Defined in:
lib/mono/git/tool.rb

Class Method Summary collapse

Class Method Details

.main(args = ARGV) ⇒ Object



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
30
31
32
# File 'lib/mono/git/tool.rb', line 5

def self.main( args=ARGV )

 ## note: for now assume first argument is command
 ##  add options later

 cmd = if args.size == 0
         'status'   ## make status "default" command
       else
         args.shift   ## remove first (head) element
       end

 ## note: allow shortcut for commands
 case cmd.downcase
 when 'status', 'stati', 'stat', 's'
    Mono.status
 when 'sync', 'syn', 'sy',  ## note: allow aliases such as install, get & up too
      'get', 'g',
      'install', 'insta', 'inst', 'ins', 'i',
      'up', 'u'
    Mono.sync
 when 'env', 'e'
    Mono.env
 else
   puts "!! ERROR: unknown command >#{cmd}<"
   exit 1
 end

end