Sha256: bc0b59c7eaaa1622a1b6bb5eb9393ec310e4d3fe22b2758051b4f1af5dd9e3ce

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

# -*- coding: utf-8 -*-
# Copyright (C) 2011, 2015 Rocky Bernstein <rockyb@rubyforge.net>
require_relative '../base/subcmd'

class Trepan::Subcommand::SetConfirm < Trepan::SetBoolSubcommand
  unless defined?(HELP)
    Trepanning::Subcommand.set_name_prefix(__FILE__, self)
    HELP = <<-EOH
**#{PREFIX.join(' ')}**

Some commands have drastic effects, so in interactive mode, we confirm
these operations. Some commands have a ! suffix to disable that
confirmation for that specific instance. This command enables or
disables confirmation across *all* potentially dangerous commands,

See also:
---------

`show confirm`
EOH
    SHORT_HELP = "Set whether to confirm potentially dangerous operations."
    IN_LIST    = true
    MIN_ABBREV = 'co'.size
  end
end

if __FILE__ == $0
  # Demo it.
  $0 = __FILE__ + 'notagain' # So we don't run this agin
  require_relative '../../mock'
  cmd = MockDebugger::sub_setup(Trepan::Subcommand::SetConfirm, false)
  cmd.run(cmd.prefix + ['off'])
  cmd.run(cmd.prefix + ['ofn'])
  cmd.run(cmd.prefix)
  puts cmd.save_command
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trepanning-2.15.35 processor/command/set_subcmd/confirm.rb
trepanning-1.93.35 processor/command/set_subcmd/confirm.rb
trepanning-2.15.33 processor/command/set_subcmd/confirm.rb
trepanning-1.93.32 processor/command/set_subcmd/confirm.rb