Class: IndexHtml::CLI

Inherits:
BaseCLI
  • Object
show all
Defined in:
lib/index_html/cli.rb

Instance Method Summary collapse

Methods inherited from BaseCLI

shared_options

Instance Method Details

#generateObject



73
74
75
76
77
78
79
# File 'lib/index_html/cli.rb', line 73

def generate
  if options[:version]
    puts "You are using IndexHtml Version #{IndexHtml::VERSION}"
    exit
  end
  IndexHtml::Main.run(options.symbolize_keys)
end

#usageObject



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/index_html/cli.rb', line 82

def usage
  puts "Usage:\n  cli.rb generate\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  -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  -p, [--prefix=PREFIX]                    # Prefix string to the URL\n  d, [--indent=N]                          # Indentation to each list item in the output\n                                       # Default: 6\n  -o, [--output=OUTPUT]                    # Output file name\n                                       # Default: index.html\n  -v, [--version], [--no-version]          # Display version information\n\nGenerate the index.html base on simple criteria\n  EOS\nend\n"