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 "Usage:\n  code_lister\n\nOptions:\n  -b, [--base-dir=BASE_DIR]                # Base directory\n                                       # Default: . (current directory)\n  -e, [--exts=one two three]               # List of extensions to search for\n  -f, [--non-exts=one two three]           # List of files without extension to search for\n  -n, [--inc-words=one two three]          # List of words in the filename to be included with the result if any\n  -x, [--exc-words=one two three]          # List of words in the filename to be excluded from the result if any\n  -i, [--ignore-case], [--no-ignore-case]  # Ignore the case in the input filename\n                                       # Default: --ignore_case\n  -r, [--recursive], [--no-recursive]      # Search for files recursively\n                                       # Default: --recursive\n  -v, [--version], [--no-version]          # Display version information\n\nList files by extensions, patterns, and simple criteria\n  EOS\nend\n"