[pve-devel] [PATCH access-control v5 2/5] PVE::AccessControl: register userid with completion

Stoiko Ivanov s.ivanov at proxmox.com
Thu Jun 21 14:31:44 CEST 2018


Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 PVE/AccessControl.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/PVE/AccessControl.pm b/PVE/AccessControl.pm
index f847a8b..11370a4 100644
--- a/PVE/AccessControl.pm
+++ b/PVE/AccessControl.pm
@@ -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');
-- 
2.11.0





More information about the pve-devel mailing list