Class: Treedent::CLI
- Inherits:
-
Object
- Object
- Treedent::CLI
- Defined in:
- lib/treedent/cli.rb
Class Method Summary collapse
Class Method Details
.format ⇒ Object
20 21 22 |
# File 'lib/treedent/cli.rb', line 20 def self.format puts Treedent::FormattedOutput.new(ARGF.read).to_s end |
.options?(*values) ⇒ Boolean
24 25 26 |
# File 'lib/treedent/cli.rb', line 24 def self.(*values) values.any? { |value| ARGV.include?(value) } end |
.start ⇒ Object
6 7 8 9 10 |
# File 'lib/treedent/cli.rb', line 6 def self.start return usage if ('-h', '--help') return version if ('-v', '--version') format end |
.usage ⇒ Object
12 13 14 |
# File 'lib/treedent/cli.rb', line 12 def self.usage puts Pathname(__dir__).join('..', '..', 'USAGE').read end |