PVE::AccessControl: register userid with completion
authorStoiko Ivanov <s.ivanov@proxmox.com>
Thu, 21 Jun 2018 12:31:44 +0000 (14:31 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 27 Jun 2018 14:40:55 +0000 (16:40 +0200)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PVE/AccessControl.pm

index 0fb46b5..44fc0aa 100644 (file)
@@ -14,7 +14,7 @@ use PVE::OTP;
 use PVE::Ticket;
 use PVE::Tools qw(run_command lock_file file_get_contents split_list safe_print);
 use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file cfs_lock_file);
-use PVE::JSONSchema;
+use PVE::JSONSchema qw(register_standard_option get_standard_option);
 
 use PVE::Auth::Plugin;
 use PVE::Auth::AD;
@@ -1078,6 +1078,10 @@ sub remove_vm_from_pool {
 
 # bash completion helpers
 
+register_standard_option('userid-completed',
+    get_standard_option('userid', { completion => \&complete_username}),
+);
+
 sub complete_username {
 
     my $user_cfg = cfs_read_file('user.cfg');