Class: VimPrinter::CLI

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

Instance Method Summary collapse

Instance Method Details



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

def print
  opts = options.symbolize_keys
  if opts[:version]
    puts "You are using VimPrinter version #{VimPrinter::VERSION}"
    exit
  end
  execute(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
61
62
# File 'lib/vim_printer/cli.rb', line 38

def usage
  puts "Usage:\n  vim_printer\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 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  -t, [--theme=THEME]                      # Vim colorscheme to use\n                                       # Default: default\n  -c, [--index], [--no-index]              # Generate the index.html file for the result\n                                       # Default: true\n\nPrint files to (x)html using Vim\n  EOS\nend\n"