Commit Graph

27 Commits

Author SHA1 Message Date
Dietmar Maurer
bd0e50532b pvesh cleanup: use a handler class - PVE/CLI/pvesh.pm 2018-07-26 15:20:15 +02:00
Dietmar Maurer
b35fe93178 pvesh: implement 'ls' command 2018-07-26 13:09:08 +02:00
Dietmar Maurer
9bb8ce6be0 pvesh: do not use CLIHandler $option parameter, simplify code 2018-07-26 13:09:08 +02:00
Dietmar Maurer
25b6579121 pvesh: use standard output options
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 11:27:13 +02:00
Dietmar Maurer
864a5845ec pvesh usage: correctly handle uri paramaeters, cleanups
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 11:27:13 +02:00
Dietmar Maurer
4012507fd7 pvesh usage: new option --returns to print result schema
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 11:27:13 +02:00
Wolfgang Bumiller
9730f1e239 fixup pvesh for changes in pve-common
In pve-common the following changes happened:
  0adee98 ("cli_handler: pass common output options as separate parameter")
  352b7a1 ("PVE::CLIFormatter - implement new output options")
We now get the format passed via an options hash in the
output function instead of seeing it as an api call
parameter.

Similarly, --quiet is now already handled there.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-07-11 10:51:14 +02:00
Dietmar Maurer
be96a59334 pvesh: complete rewrite using PVE::CLIHandler
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 10:36:32 +02:00
Dietmar Maurer
a306ed1315 pvesh - remove interactive readline mode
We have good command line completion and history with 'bash', so there is
no real need to duplicate this functionality.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 10:36:32 +02:00
Dominik Csapak
396530df43 fix correct call to 'usage_str'
we forgot to give usage_str also the param_mapping sub,
else it fails on calling 'help'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-28 13:15:13 +02:00
Dominik Csapak
067e452b48 use PVE::RESTHandler explicitly
since we use it in the code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-27 12:19:52 +02:00
Dominik Csapak
12248c4dce replace read_password with param_mapping in pvesh
and use get_standard_mapping from CLIHandler

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-27 12:19:45 +02:00
Dominik Csapak
050b8c0247 fix #1539: add missing shellquote for proxied commands of pvesh
if we do not do this, passing arguments with spaces
(e.g., pvesh set YYY --param "one word")
leads to ssh calls like this:
ssh REMOTE pvesh set YYY --param one word

which cannot be parsed correctly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-10-31 08:28:10 +01:00
Dietmar Maurer
fdb3516b4a PVE::API2Tools::resolve_proxyto - new helper
Call proxyto_callback if that method is defined.
2017-05-31 08:23:47 +02:00
Dominik Csapak
35e1fa3fae 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>
2016-11-25 15:24:22 +01:00
Dominik Csapak
9d9e015dda don't save password and double lines in pvesh history
we assumed that Term::ReadLine does not put
input into the history automatically, but it does this

so if this feature is enabled, we do not have to add
the inputs manually, and we have to delete the password
from the history

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-08-03 12:23:01 +02:00
Dietmar Maurer
ebd4ba37a9 pvesh: use PVE::SafeSyslog 2016-01-22 11:24:17 +01:00
Emmanuel Kasper
4f406f4518 pvesh man page 2015-09-10 12:22:09 +02:00
Dietmar Maurer
1a0a454209 pvesh: fix help command 2014-05-07 12:31:55 +02:00
Stefan Priebe
cc04752964 do not use -w switch as it breaks modules
-w enabled warnings for all modules - even when these modules comes from the OS and are not compatible
with warnings. This is the reason to NOT use -w and instead use "use warnings".
2013-10-01 10:36:47 +02:00
Dietmar Maurer
3dc6e6c709 add option --nooutput 2012-04-20 08:20:44 +02:00
Dietmar Maurer
f4b4dd12bf use utf8 encoding 2012-01-27 08:51:21 +01:00
Dietmar Maurer
bcde5fa580 avoid warning 2012-01-26 13:03:09 +01:00
Dietmar Maurer
0710edb39d ipmlement proxy code for pvesh 2011-12-23 14:11:44 +01:00
Dietmar Maurer
f9e2a4c2a7 avoid warning about uninitialized values 2011-12-21 09:06:32 +01:00
Dietmar Maurer
d238821aa7 correctly print string return values 2011-12-21 08:55:53 +01:00
Dietmar Maurer
5910d3b7bd imported from svn 'pve-manager/pve2' 2011-08-23 07:40:22 +02:00