X-Git-Url: https://git.proxmox.com/?p=pve-client.git;a=blobdiff_plain;f=PVE%2FAPIClient%2FConfig.pm;h=40caed86f92f3869a79be0ebfc78b14df48c6ff0;hp=6c5b537d84c3aca9cb17b3ad7517f16bde638b14;hb=184877d47a543e4bf5b08548a380f0d6e1bcc3a8;hpb=eaf20c2f298317719ded08cfda27016adcaa3a4f;ds=sidebyside diff --git a/PVE/APIClient/Config.pm b/PVE/APIClient/Config.pm index 6c5b537..40caed8 100644 --- a/PVE/APIClient/Config.pm +++ b/PVE/APIClient/Config.pm @@ -5,8 +5,22 @@ use warnings; use JSON; use File::HomeDir (); +use PVE::JSONSchema qw(register_standard_option get_standard_option); use PVE::Tools qw(file_get_contents file_set_contents); +my $complete_remote_name = sub { + + my $config = PVE::APIClient::Config->new(); + return $config->remote_names; +}; + +register_standard_option('pveclient-remote-name', { + description => "The name of the remote.", + type => 'string', + pattern => qr(\w+), + completion => $complete_remote_name, +}); + sub new { my ($class) = @_;