From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 4166D69E5C for ; Wed, 15 Sep 2021 15:41:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2F33719A87 for ; Wed, 15 Sep 2021 15:41:54 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 4BA0C19A6F for ; Wed, 15 Sep 2021 15:41:53 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 72207448A1 for ; Wed, 15 Sep 2021 15:36:38 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pbs-devel@lists.proxmox.com Date: Wed, 15 Sep 2021 15:36:33 +0200 Message-Id: <20210915133634.4149021-1-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.400 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [format.rs] Subject: [pbs-devel] [RFC proxmox 1/2] schema: print item type-text instead of X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 13:41:54 -0000 this is only used for CLI synopsis/usage strings, the API viewer already prints the full type text in a correct format. the old variant was also rather misleading, since on the CLI we don't pass in an array, but each item as its own parameter. Signed-off-by: Fabian Grünbichler --- noticed this while working on the pull/sync filtering series, but it affects quite a lot of stuff, among other things the Updater/Deleteable CLI, e.g. from `man proxmox-backup-manager`: --delete List of properties to delete. vs. --delete disable|validation-delay List of properties to delete. but some of them might only have as the item type text, which is not much nicer :-/ the whole "List of .." is confusing anyway, but not easily solvable, since the description is used for - API dump/viewer (where it is a list/array of ..) - usage message/man pages (where it's a parameter that gives a single element, but it might be passed in multiple times to construct an array) also for some common occurences, the item description is too generic, and it's not possible to override the description for external types with the current api macro. proxmox/src/api/format.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox/src/api/format.rs b/proxmox/src/api/format.rs index 7f16e93..a362b21 100644 --- a/proxmox/src/api/format.rs +++ b/proxmox/src/api/format.rs @@ -120,7 +120,7 @@ pub fn get_schema_type_text(schema: &Schema, _style: ParameterDisplayStyle) -> S _ => String::from(""), }, Schema::Object(_) => String::from(""), - Schema::Array(_) => String::from(""), + Schema::Array(schema) => get_schema_type_text(schema.items, _style), Schema::AllOf(_) => String::from(""), } } -- 2.30.2