IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
format can now be:
plain => what we had with 'text' before
text => print with borders (default)
json
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Use setpgid + tcsetpgrp instead of setsid if $sync (invocation via
cli), thus keeping /dev/tty - ssh-copy-id/ssh need it to read the
password, and putting the child in the forground. Further, ignore
SIGTTOU in child process (otherwise it gets stopped upon tcsetpgrp)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
we have a param_mapping now, with which we can impement that
e.g. instead of using:
sub read_password {
# read password
}
we can do:
sub param_mapping {
my ($name) = @_;
my $password_map = ['password', sub{
# read password
}, '<password', 1];
my $mapping = {
'apicall1' => [$password_map],
'apicall2' => [$password_map],
...
};
return $mapping->{$name};
}
this has the advantage that we can use different subs for different
api calls (e.g. pveum passwd vs pveum ticket)
if a CLIHandler implemenation still has a read_password sub and no
param_mapping, we generate one for them with read_password as the
sub for the standard mapping 'pve-password'
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
print_api_list falls back to the union of all properties occuring in data, if
none are provided explicitly, and the API method contains no returns property.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Sort only if at least one column contains no undefined values.
Sort according to the left-most such column.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
instead of writing:
['name', sub {...}, 'description', 1]
one can now use:
{
name => 'name',
func => sub { ... },
desc => 'desc',
interactive => 1,
}
which makes it more obvious what is what
(and allows later patches to easily override some things)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
print_api_list takes an array of columns to print, the data, and the returns
definitions of the API, and prints the data by using print_text_table.
handle_cmd and handle_simple_cmd call the output sub with the returns definitons.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
These two function could serve as a generic output sub for various CLI
utilities
* print_text_table prints an array of objects in a tabular fashion,
the formating is passed as an array containg hashes with titles, maximal
lengths and default values. This way we can stay extensible, by adding other
keys to the formatting options
* print_entry prints out a single entry, handling array-refs as properties
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
remove the cleanup of the not produced ${PACKAGE}-*.tar.gz file.
This is here since the import from SVN, but is not needed since quite
a time.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>