[pve-devel] [PATCH pve-common] auto completion: let class name and binary name differ

Dietmar Maurer dietmar at proxmox.com
Mon Sep 14 16:57:44 CEST 2015



> On September 14, 2015 at 2:15 PM Thomas Lamprecht <t.lamprecht at proxmox.com>
> wrote:
> 
> 
> Before this commit we assumed that the class name of an CLIHandler
> derived class is equal to its executable name. This led to problems
> when an cli executable name contained characters invalid for a class
> name, e.g. an hyphen like ha-manager has.
> 
> Now we distinguishes between class and binary names. A, from
> CLIHandler derived, class can use:
> 
> our exename = "...";
> 
> to set an specific executable name used to generate pod and
> autocompletion files. If this variable is not set we keep the
> current behaviour and use the classname for exename.
> 
> Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
> ---
>  src/PVE/CLIHandler.pm | 40 ++++++++++++++++++++++++++++++----------
>  1 file changed, 30 insertions(+), 10 deletions(-)
> 
> diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm
> index e6fd415..4c29ed3 100644
> --- a/src/PVE/CLIHandler.pm
> +++ b/src/PVE/CLIHandler.pm
> @@ -13,6 +13,7 @@ use base qw(PVE::RESTHandler);
>  
>  my $cmddef;
>  my $exename;
> +my $classname;

Do we really need this additional var?




More information about the pve-devel mailing list