Class: FilenameCleaner::CLI

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

Instance Method Summary collapse

Instance Method Details

#renameObject



25
26
27
28
29
30
31
32
# File 'lib/filename_cleaner/cli.rb', line 25

def rename
  opts = options.symbolize_keys
  if opts[:version]
    puts "You are using Filename Cleaner version #{FilenameCleaner::VERSION}"
    exit
  end
  sanitize_and_rename(opts)
end

#usageObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/filename_cleaner/cli.rb', line 35

def usage
  puts "Usage:\n  filename_cleaner rename\n\nOptions:\n  -b, [--base-dir=BASE_DIR]                # Base directory\n                                       # Default: . (current directory name)\n  -e, [--exts=one two three]               # List of extensions to search for\n  -n, [--inc-words=one two three]          # List of words to be included in the result if any\n  -x, [--exc-words=one two three]          # List of words to be excluded from the result if any\n  -i, [--ignore-case], [--no-ignore-case]  # Match case insensitively\n                                       # Default: true\n  -r, [--recursive], [--no-recursive]      # Search for files recursively\n                                       # Default: true\n  -v, [--version], [--no-version]          # Display version information\n  -s, [--sep-char=SEP_CHAR]                # Separator char to use\n                                       # Default: .\n  -c, [--commit], [--no-commit]            # Commit your changes\n\nSanitize and rename file with special characters\n  EOS\nend\n"