Files
ubicloud/cli-commands/vm/post/sftp.rb
Jeremy Evans de9716073c Use single argument for VM reference
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.
2025-02-07 09:14:38 -08:00

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