Sha256: b440d131179aadf57a915e39b9fa323d89e2a223cd692c9283bec456cf9c3965
Contents?: true
Size: 1.05 KB
Versions: 3
Compression:
Stored size: 1.05 KB
Contents
# Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net> require 'rubygems'; require 'require_relative' require_relative '../command' require_relative '../load_cmds' class Trepan::Command::CompleteCommand < Trepan::Command unless defined?(HELP) NAME = File.basename(__FILE__, '.rb') HELP = <<-HELP #{NAME} COMMAND-PREFIX List the completions for the rest of the line as a command. HELP CATEGORY = 'support' NEED_STACK = false SHORT_HELP = 'List the completions for the rest of the line as a command' end # This method runs the command def run(args) # :nodoc last_arg = @proc.cmd_argstr.end_with?(' ') ? '' : args[-1] @proc.complete(@proc.cmd_argstr, last_arg).each do |match| msg match end end end if __FILE__ == $0 # Demo it. require_relative '../mock' dbgr, cmd = MockDebugger::setup %w(k b bt).each do |prefix| cmd.proc.instance_variable_set('@cmd_argstr', prefix) cmd.run [cmd.name, prefix] puts '=' * 40 end cmd.run %w(#{cmd.name} fdafsasfda) puts '=' * 40 end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rb8-trepanning-0.1.6 | processor/command/complete.rb |
rb8-trepanning-0.1.5 | processor/command/complete.rb |
rb8-trepanning-0.1.4 | processor/command/complete.rb |