[pve-devel] applied: [PATCH pve-client] rename defaut output format from 'table' to 'text'

Dietmar Maurer dietmar at proxmox.com
Thu Jun 14 12:27:54 CEST 2018


applied

> On June 14, 2018 at 12:00 PM Dietmar Maurer <dietmar at proxmox.com> wrote:
> 
> 
> Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
> ---
>  PVE/APIClient/Commands/list.pm | 2 +-
>  PVE/APIClient/Config.pm        | 4 ++--
>  PVE/APIClient/Helpers.pm       | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/PVE/APIClient/Commands/list.pm b/PVE/APIClient/Commands/list.pm
> index f12ef87..2030c51 100644
> --- a/PVE/APIClient/Commands/list.pm
> +++ b/PVE/APIClient/Commands/list.pm
> @@ -31,7 +31,7 @@ __PACKAGE__->register_method ({
>  	my $conn = PVE::APIClient::Config->remote_conn($config, $param->{remote});
>  	my $resources = $conn->get('api2/json/cluster/resources', { type => 'vm' });
>  
> -	if (!defined($param->{format}) or $param->{format} eq 'table') {
> +	if (!defined($param->{format}) or $param->{format} eq 'text') {
>  	    my $headers = ['Node', 'VMID', 'Type', 'Name', 'Status'];
>  	    my $data = [];
>  	    for my $el (@$resources) {
> diff --git a/PVE/APIClient/Config.pm b/PVE/APIClient/Config.pm
> index 3f2efe5..249ef83 100644
> --- a/PVE/APIClient/Config.pm
> +++ b/PVE/APIClient/Config.pm
> @@ -28,9 +28,9 @@ my $complete_remote_name = sub {
> 
> PVE::APIClient::JSONSchema::register_standard_option('pveclient-output-format',
> {
>      type => 'string',
>      description => 'Output format.',
> -    enum => [ 'table', 'json' ],
> +    enum => [ 'text', 'json' ],
>      optional => 1,
> -    default => 'table',
> +    default => 'text',
>  });
>  
>  PVE::APIClient::JSONSchema::register_standard_option('pveclient-remote-name',
> {
> diff --git a/PVE/APIClient/Helpers.pm b/PVE/APIClient/Helpers.pm
> index 7aec160..cc19514 100644
> --- a/PVE/APIClient/Helpers.pm
> +++ b/PVE/APIClient/Helpers.pm
> @@ -43,7 +43,7 @@ $build_pve_api_path_hash = sub {
>      }
>  };
>  
> -my $default_output_format = 'table';
> +my $default_output_format = 'text';
>  my $client_output_format =  $default_output_format;
>  
>  sub set_output_format {
> @@ -71,7 +71,7 @@ sub print_result {
>  
>      if ($format eq 'json') {
>  	print to_json($data, {utf8 => 1, allow_nonref => 1, canonical => 1, pretty
> => 1 });
> -    } elsif ($format eq 'table') {
> +    } elsif ($format eq 'text') {
>  	my $type = $result_schema->{type};
>  	if ($type eq 'object') {
>  	    die "implement me";
> -- 
> 2.11.0
> 
> 




More information about the pve-devel mailing list