Class: Cle::CLI

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

Overview

Command line interface class

Class Method Summary collapse

Class Method Details

.parse(arguments) ⇒ Object

Parse CLI arguments.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/cle/cli.rb', line 17

def self.parse(arguments) # rubocop:disable Metrics/MethodLength
  OptionParser.new do |opts|
    opts.banner = <<~BANNER
      Completely clear terminal screen.

      Usage: cle
    BANNER

    opts.version = Cle::VERSION
    opts.on('-h', '--help', 'Display help.') do
      puts opts
      exit
    end

    opts.parse(arguments)
  end
end

.run(arguments) ⇒ Object

Run CLI.



9
10
11
12
13
# File 'lib/cle/cli.rb', line 9

def self.run(arguments)
  CLI.parse(arguments)

  Cle.clear
end