Class: Byebug::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/byebug/options.rb

Overview

Set of options that byebug’s script accepts.

Class Method Summary collapse

Class Method Details

.parseObject



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
35
36
37
38
39
40
41
42
43
44
# File 'lib/byebug/options.rb', line 6

def self.parse
  Slop.parse!(strict: true) do
    banner "\nbyebug \#{Byebug::VERSION}\n\nUsage: byebug [options] <script.rb> -- <script.rb parameters>\n".gsub(/^ {8}/, '')

    on :d, :debug, 'Set $DEBUG=true' do
      $DEBUG = true
    end

    on :I, :include=, 'Add to $LOAD_PATH', as: Array, delimiter: ':' do |l|
      $LOAD_PATH.push(l).flatten!
    end

    on :q, :quit, 'Quit when script finishes', default: true

    on :s, :stop, 'Stop when script is loaded', default: true

    on :x, :rc, 'Run byebug initialization file', default: true

    on :m, :'post-mortem', 'Run byebug in post-mortem mode', default: false

    on :r, :require=, 'Require library before script' do |name|
      require name
    end

    on :R, :remote=, '[HOST:]PORT for remote debugging',
       as: Array, delimiter: ':', limit: 2

    on :t, :trace, 'Turn on line tracing'

    on :v, :version, 'Print program version'

    on :h, :help, 'Display this message'
  end
end