Module: Clin

Defined in:
lib/clin.rb,
lib/clin/errors.rb,
lib/clin/version.rb

Overview

Clin version

Defined Under Namespace

Modules: CommandMixin, LineReader Classes: Argument, Command, CommandDispatcher, CommandLineError, CommandParser, GeneralOption, HelpError, HelpOptions, MissingArgumentError, MissingOptionArgumentError, Option, OptionError, OptionList, OptionParser, OptionUnexpectedArgumentError, RequiredArgumentError, Shell, ShellInteraction, Text, UnknownOptionError

Constant Summary collapse

Error =

Parent error class for all Clin errors

Class.new(RuntimeError)
ArgumentError =

Error when an positional argument is wrong

Class.new(CommandLineError)
VERSION =
'0.4.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.diff_cmdObject



28
29
30
# File 'lib/clin.rb', line 28

def diff_cmd
  @diff_cmd ||= 'diff -u'
end

.exe_nameObject

Global exe_name If this is not override it will be ‘command’



24
25
26
# File 'lib/clin.rb', line 24

def exe_name
  @exe_name ||= Clin.default_exe_name
end

.use_readline=(value) ⇒ Object (writeonly)

If the line reader should use Readline(For autocomplete and history)



16
17
18
# File 'lib/clin.rb', line 16

def use_readline=(value)
  @use_readline = value
end

Class Method Details

.default_exe_nameObject



18
19
20
# File 'lib/clin.rb', line 18

def default_exe_name
  'command'
end

.use_readline?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/clin.rb', line 32

def use_readline?
  @use_readline ||= !ENV['CLIN_NO_READLINE']
end