Commit Graph

27 Commits

Author SHA1 Message Date
Dietmar Maurer
ece19ae214 pvesh cleanup: use a handler class - PVE/CLI/pvesh.pm 2018-07-26 15:20:15 +02:00
Dietmar Maurer
3522eed9c2 pvesh: implement 'ls' command 2018-07-26 13:09:08 +02:00
Dietmar Maurer
52170c5553 pvesh: do not use CLIHandler $option parameter, simplify code 2018-07-26 13:09:08 +02:00
Dietmar Maurer
1c57847c09 pvesh: use standard output options
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 11:27:13 +02:00
Dietmar Maurer
0e99eead10 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
a831f4be80 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
2565b25d4f 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
46028e7432 pvesh: complete rewrite using PVE::CLIHandler
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 10:36:32 +02:00
Dietmar Maurer
cfc6a66293 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
f08b396c3b 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
f9c9a7da8c 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
be968cb617 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
4114aeac32 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
3c54bc912b PVE::API2Tools::resolve_proxyto - new helper
Call proxyto_callback if that method is defined.
2017-05-31 08:23:47 +02:00
Dominik Csapak
8d365d994f 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
613ac9486b 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
1d9f1e8dbc pvesh: use PVE::SafeSyslog 2016-01-22 11:24:17 +01:00
Emmanuel Kasper
f6b62dd260 pvesh man page 2015-09-10 12:22:09 +02:00
Dietmar Maurer
435063bdd9 pvesh: fix help command 2014-05-07 12:31:55 +02:00
Stefan Priebe
776de3bc0d 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
4b72af232c add option --nooutput 2012-04-20 08:20:44 +02:00
Dietmar Maurer
b9938a0bcb use utf8 encoding 2012-01-27 08:51:21 +01:00
Dietmar Maurer
40a9e2bfb7 avoid warning 2012-01-26 13:03:09 +01:00
Dietmar Maurer
46e067ac37 ipmlement proxy code for pvesh 2011-12-23 14:11:44 +01:00
Dietmar Maurer
165337e272 avoid warning about uninitialized values 2011-12-21 09:06:32 +01:00
Dietmar Maurer
f28d0dcfba correctly print string return values 2011-12-21 08:55:53 +01:00
Dietmar Maurer
aff192e6f5 imported from svn 'pve-manager/pve2' 2011-08-23 07:40:22 +02:00