Class: Mp4Renamer::CLI

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

Instance Method Summary collapse

Instance Method Details

#executeObject



22
23
24
25
26
27
28
29
# File 'lib/mp4_renamer/cli.rb', line 22

def execute
  opts = options.symbolize_keys
  if opts[:version]
    puts "You are using Mp4Renamer version #{Mp4Renamer::VERSION}"
    exit
  end
  process(opts)
end

#usageObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/mp4_renamer/cli.rb', line 32

def usage
  puts <<-EOS
Usage:
  mp4_renamer [options]

Options:
  -b, [--base-dir=BASE_DIR]        # Starting directory
                               # Default: . (current directory)
  -r, [--recursive=RECURSIVE]      # Perform the operation recursively
                               # Default: true
  -c, [--commit], [--no-commit]    # Commit your changes
                               # Default: --no-commit
  -v, [--version], [--no-version]  # Display version number
                               # Default: --no-version

Execute the main program
  EOS
end