Module: Ompload::CLI
Instance Method Summary collapse
Methods included from Shell
curl_installed?, piped_data_given?, xclip_installed?
Instance Method Details
#run(argv, options = {}) ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/ompload.rb', line 185 def run(argv, = {}) unless curl_installed? abort('error: curl missing or not in path. Cannot continue.') end if [:version] puts VERSION exit end abort(USAGE) if ARGV.size < 1 && !piped_data_given? || [:help] UploadsHandler.handle_files(ARGV, ) UploadsHandler.handle_data(STDIN.read(), ) if piped_data_given? if xclip_installed? && [:clip] && !XclipBuffer.instance.content.empty? IO.popen('xclip', 'w+').puts XclipBuffer.instance.content end if ![:quiet] && ![:url] if ErrorCounter.instance.count > 0 puts "Finished with #{ErrorCounter.instance.count} errors." else puts 'Success.' end end end |