Created
October 31, 2009 07:23
-
-
Save jugyo/222968 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Termtter::Client | |
register_command( | |
:async, | |
:alias => :a, | |
:help => ['async COMMAND', 'asynchronously execute the command'], | |
:completion => lambda {|cmd, arg| | |
commands.map{|name, command| command.complement(arg)}. | |
flatten. | |
compact. | |
map{|i| "#{cmd} #{i}"} | |
}, | |
:exec => lambda {|arg| | |
@task_manager.invoke_later do | |
begin | |
call_commands(arg) | |
rescue Exception => e | |
handle_error(e) | |
end | |
Readline.refresh_line | |
end | |
} | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment