Class: FilenameCleaner::CLI

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

Instance Method Summary collapse

Instance Method Details

#cleanObject



28
29
30
31
32
33
34
35
# File 'lib/filename_cleaner/cli.rb', line 28

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

#usageObject



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

def usage
  puts <<-EOS
Usage:
  filename_cleaner clean [OPTIONS]

Options:
  -b, [--base-dir=BASE_DIR]                # Base directory
                                       # Default: . (current directory)
  -e, [--exts=one two three]               # List of extensions to search for
  -f, [--non-exts=one two three]           # List of files without extension to search for
  -n, [--inc-words=one two three]          # List of words to be included in the result if any
  -x, [--exc-words=one two three]          # List of words to be excluded from the result if any
  -i, [--ignore-case], [--no-ignore-case]  # Match case insensitively
                                       # Default: true
  -r, [--recursive], [--no-recursive]      # Search for files recursively
                                       # Default: true
  -v, [--version], [--no-version]          # Display version information
  -s, [--sep-char=SEP_CHAR]                # Separator char to use
                                       # Default: .
  -d, [--dry-run], [--no-dry-run]          # Perform a dry run only
                                       # Default: true
  EOS
end