class Hotdog::Commands::Scp
Public Instance Methods
define_options(optparse, options={})
click to toggle source
Calls superclass method
# File lib/hotdog/commands/scp.rb, line 10 def define_options(optparse, options={}) program_name = File.basename($0, '.*') optparse.banner = "Usage: #{program_name} scp [options] pattern -- src @:dst" super end
Private Instance Methods
build_command_string(host, command=nil, options={})
click to toggle source
# File lib/hotdog/commands/scp.rb, line 17 def build_command_string(host, command=nil, options={}) # replace "@:" by actual hostname cmdline = Shellwords.shellsplit(options.fetch(:scp_command, "scp")) + build_command_options(options) + Shellwords.split(command).map { |token| token.gsub(/@(?=:)/, host) } Shellwords.join(cmdline) end