Class: CodeLister::CLI

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

Instance Method Summary collapse

Instance Method Details

#findObject



14
15
16
17
18
19
20
21
# File 'lib/code_lister/cli.rb', line 14

def find
  opts = options.deep_symbolize_keys
  if opts[:version]
    puts "You are using CodeLister Version #{CodeLister::VERSION}"
    exit
  end
  CodeLister::Main.run(opts)
end

#usageObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/code_lister/cli.rb', line 24

def usage
  puts <<-EOS
Usage:
  code_lister

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 in the filename to be included with the result if any
  -x, [--exc-words=one two three]          # List of words in the filename to be excluded from the result if any
  -i, [--ignore-case], [--no-ignore-case]  # Ignore the case in the input filename
                                       # Default: --ignore_case
  -r, [--recursive], [--no-recursive]      # Search for files recursively
                                       # Default: --recursive
  -v, [--version], [--no-version]          # Display version information

List files by extensions, patterns, and simple criteria
  EOS
end