Sha256: ff6673ae1ed737234ebb8bc7b7639adfb359f97fba5eede59e19b8bf72c4a854

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'methadone'
require 'fix_iphone_picture_orientation.rb'

class App
  include Methadone::Main
  include Methadone::CLILogging

  main do |directory|
    logger.level=Logger::WARN if options[:quiet]
    logger.error_level = Logger::DEBUG if options[:debug]

    directory ||= Dir.pwd
    
    FixIphonePictureOrientation.run(directory) or
      warn "Not all files processed"

  end

  # supplemental methods here

  # Declare command-line interface here

  description "Fix iPhone photos with bad orientations"

  # Accept flags via:
  # on("--flag VAL","Some flag")
  # options[flag] will contain VAL
  #
  # Specify switches via:
  # on("--[no-]switch","Some switch")
  on("--quiet","Run silently unless there are errors")
  on("--debug","Turn on debugging info")


  # Or, just call OptionParser methods on opts
  #
  # Require an argument
  # arg :some_arg 

  # # Make an argument optional
  # arg :optional_arg, :optional
  arg :directory,:optional, "Directory to run conversion upon.","Default is current directory."

  version FixIphonePictureOrientation::VERSION

  use_log_level_option

  go!
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fix_iphone_picture_orientation-0.0.1 bin/fix_iphone_picture_orientation