This argument must currently be in the format "location/(vm-name|_vm-ubid)". This format makes it easier to support just "vm-ubid" or "vm-name" in a backwards compatible manner in the future.
15 lines
393 B
Ruby
15 lines
393 B
Ruby
# frozen_string_literal: true
|
|
|
|
UbiRodish.on("vm").run_on("sftp") do
|
|
options("ubi vm location-name/(vm-name|_vm-ubid) sftp [options] [-- sftp-options]", key: :vm_ssh, &UbiCli::SSHISH_OPTS)
|
|
|
|
args(0...)
|
|
|
|
run do |argv, opts|
|
|
handle_ssh(opts) do |user:, address:|
|
|
address = "[#{address}]" if address.include?(":")
|
|
["sftp", *argv, "--", "#{user}@#{address}"]
|
|
end
|
|
end
|
|
end
|