-
Notifications
You must be signed in to change notification settings - Fork 29
/
cli.rb
34 lines (30 loc) · 805 Bytes
/
cli.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
%w(commands options).each { |p| require File.join(Loops::LIB_ROOT, 'loops/cli', p) }
module Loops
# Command line interface for the Loops system.
#
# Used to parse command line options, initialize engine, and
# execute command requested.
#
# @example
# Loops::CLI.execute
#
class CLI
include Commands, Options
# Register all available commands.
register_command :list
register_command :debug
register_command :start
register_command :stop
# @return [Array<String>]
# The +Array+ of (unparsed) command-line options.
attr_reader :args
# Initializes a new instance of the {CLI} class.
#
# @param [Array<String>] args
# an +Array+ of command line arguments.
#
def initialize(args)
@args = args.dup
end
end
end