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 = "      Completely clear terminal screen.\n\n      Usage: cle\n    BANNER\n\n    opts.version = Cle::VERSION\n    opts.on('-h', '--help', 'Display help.') do\n      puts opts\n      exit\n    end\n\n    opts.parse(arguments)\n  end\nend\n"

.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