Module: GitMedia::Application

Defined in:
lib/git-media.rb

Class Method Summary collapse

Class Method Details

.run!Object



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/git-media.rb', line 96

def self.run!
  
  cmd = ARGV.shift # get the subcommand
  cmd_opts = case cmd
    when "filter-clean" # parse delete options
      require 'git-media/filter-clean'
      GitMedia::FilterClean.run!
    when "filter-smudge"
      require 'git-media/filter-smudge'
      GitMedia::FilterSmudge.run!
    when "clear" # parse delete options
      require 'git-media/clear'
      GitMedia::Clear.run!
    when "sync"
      require 'git-media/sync'
      GitMedia::Sync.run!
    when 'status'
      require 'git-media/status'
      Trollop::options do
        opt :force, "Force status"
      end
      GitMedia::Status.run!
    else
	  print <<EOF
usage: git media sync|status|clear

  sync		Sync files with remote server
  status	Show files that are waiting to be uploaded and file size
  clear		Upload and delete the local cache of media files

EOF
    end
  
end