mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-06-13 14:47:09 +00:00
fix #1212: allow options for delete in pvesh
we did not allow to use parameters in the delete handler in pvesh, but we make use of them (e.g. force on snapshot deleting) as the get/set and delete handler do the same, refactor the if/else paths of them Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
83576841ae
commit
8d365d994f
19
bin/pvesh
19
bin/pvesh
@ -515,7 +515,7 @@ sub pve_command {
|
||||
|
||||
list_dir(abs_path($cdir, $path), $args);
|
||||
|
||||
} elsif ($cmd eq 'get') {
|
||||
} elsif ($cmd =~ m/^get|delete|set$/) {
|
||||
|
||||
my $path;
|
||||
if (scalar(@$args) && $args->[0] !~ m/^\-/) {
|
||||
@ -533,23 +533,6 @@ sub pve_command {
|
||||
|
||||
call_method(abs_path($cdir, $path), $cmd, $args, $nooutput);
|
||||
|
||||
} elsif ($cmd eq 'delete') {
|
||||
|
||||
my $path = shift @$args;
|
||||
|
||||
die "usage: delete [path]\n" if scalar(@$args);
|
||||
|
||||
call_method(abs_path($cdir, $path), $cmd, $args);
|
||||
|
||||
} elsif ($cmd eq 'set') {
|
||||
|
||||
my $path;
|
||||
if (scalar(@$args) && $args->[0] !~ m/^\-/) {
|
||||
$path = shift @$args;
|
||||
}
|
||||
|
||||
call_method(abs_path($cdir, $path), $cmd, $args);
|
||||
|
||||
} else {
|
||||
die "unknown command '$cmd'\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user