From nobody Mon Feb 9 09:17:20 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 17101570007481000.4124742004586; Mon, 11 Mar 2024 04:36:40 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id ABBB61F18; Mon, 11 Mar 2024 07:36:39 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 20E6D1E83; Mon, 11 Mar 2024 07:31:36 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BE39B1A6E; Mon, 11 Mar 2024 07:31:06 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 095731A6E for ; Mon, 11 Mar 2024 07:31:06 -0400 (EDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-457-K5Rfyj-5OxyxKooousHWsg-1; Mon, 11 Mar 2024 07:31:04 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2AF4729AB3E1 for ; Mon, 11 Mar 2024 11:31:04 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98C19112131D for ; Mon, 11 Mar 2024 11:31:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: K5Rfyj-5OxyxKooousHWsg-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 02/23] vsh: Don't translate error messages for 'self-test' Date: Mon, 11 Mar 2024 12:30:39 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: K7WUYLEK6OVNYRLWDNKKARUK3YTDDMFE X-Message-ID-Hash: K7WUYLEK6OVNYRLWDNKKARUK3YTDDMFE X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1710157002030100001 The command invoking the code is internal and meant for developers, there's no point in translating the errors. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tools/vsh.c | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 0c41e9cfe8..61e302f9c8 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -255,7 +255,8 @@ vshCmddefGetInfo(const vshCmdDef * cmd, const char *nam= e) return NULL; } -/* Check if the internal command definitions are correct */ +/* Check if the internal command definitions are correct. + * None of the errors are to be marked as translatable. */ static int vshCmddefCheckInternals(vshControl *ctl, const vshCmdDef *cmd, @@ -271,39 +272,39 @@ vshCmddefCheckInternals(vshControl *ctl, const vshCmdDef *alias; if (!cmd->alias) { - vshError(ctl, _("command '%1$s' has inconsistent alias"), cmd-= >name); + vshError(ctl, "command '%s' has inconsistent alias", cmd->name= ); return -1; } if (!(alias =3D vshCmddefSearch(cmd->alias))) { - vshError(ctl, _("command alias '%1$s' is pointing to a non-exi= stent command '%2$s'"), + vshError(ctl, "command alias '%s' is pointing to a non-existen= t command '%s'", cmd->name, cmd->alias); return -1; } if (alias->flags & VSH_CMD_FLAG_ALIAS) { - vshError(ctl, _("command alias '%1$s' is pointing to another c= ommand alias '%2$s'"), + vshError(ctl, "command alias '%s' is pointing to another comma= nd alias '%s'", cmd->name, cmd->alias); return -1; } if (cmd->handler) { - vshError(ctl, _("command '%1$s' has handler set"), cmd->name); + vshError(ctl, "command '%s' has handler set", cmd->name); return -1; } if (cmd->opts) { - vshError(ctl, _("command '%1$s' has options set"), cmd->name); + vshError(ctl, "command '%s' has options set", cmd->name); return -1; } if (cmd->info) { - vshError(ctl, _("command '%1$s' has info set"), cmd->name); + vshError(ctl, "command '%s' has info set", cmd->name); return -1; } if (cmd->flags & ~VSH_CMD_FLAG_ALIAS) { - vshError(ctl, _("command '%1$s' has multiple flags set"), cmd-= >name); + vshError(ctl, "command '%s' has multiple flags set", cmd->name= ); return -1; } @@ -313,7 +314,7 @@ vshCmddefCheckInternals(vshControl *ctl, /* Each command has to provide a non-empty help string. */ if (!(help =3D vshCmddefGetInfo(cmd, "help")) || !*help) { - vshError(ctl, _("command '%1$s' lacks help"), cmd->name); + vshError(ctl, "command '%s' lacks help", cmd->name); return -1; } @@ -324,7 +325,7 @@ vshCmddefCheckInternals(vshControl *ctl, const vshCmdOptDef *opt =3D &cmd->opts[i]; if (i > 63) { - vshError(ctl, _("command '%1$s' has too many options"), cmd->n= ame); + vshError(ctl, "command '%s' has too many options", cmd->name); return -1; /* too many options */ } @@ -336,7 +337,7 @@ vshCmddefCheckInternals(vshControl *ctl, switch (opt->type) { case VSH_OT_BOOL: if (opt->completer || opt->completer_flags) { - vshError(ctl, _("bool parameter '%1$s' of command '%2$s' h= as completer set"), + vshError(ctl, "bool parameter '%s' of command '%s' has com= pleter set", opt->name, cmd->name); return -1; } @@ -345,7 +346,7 @@ vshCmddefCheckInternals(vshControl *ctl, case VSH_OT_STRING: if (opt->flags & VSH_OFLAG_REQ) { - vshError(ctl, _("parameter '%1$s' of command '%2$s' misuse= d VSH_OFLAG_REQ"), + vshError(ctl, "parameter '%s' of command '%s' misused VSH_= OFLAG_REQ", opt->name, cmd->name); return -1; /* neither bool nor string options can be manda= tory */ } @@ -359,9 +360,9 @@ vshCmddefCheckInternals(vshControl *ctl, char *p; if (opt->flags || !opt->help) { - vshError(ctl, _("parameter '%1$s' of command '%2$s' has in= correct alias option"), + vshError(ctl, "parameter '%s' of command '%s' has incorrec= t alias option", opt->name, cmd->name); - return -1; /* alias options are tracked by the original na= me */ + return -1; } if ((p =3D strchr(opt->help, '=3D'))) name =3D g_strndup(opt->help, p - opt->help); @@ -375,46 +376,46 @@ vshCmddefCheckInternals(vshControl *ctl, if (p) { /* If alias comes with value, replacement must not be bool= */ if (cmd->opts[j].type =3D=3D VSH_OT_BOOL) { - vshError(ctl, _("alias '%1$s' of command '%2$s' has mi= smatched alias type"), + vshError(ctl, "alias '%s' of command '%s' has mismatch= ed alias type", opt->name, cmd->name); return -1; } } if (!cmd->opts[j].name) { - vshError(ctl, _("alias '%1$s' of command '%2$s' has missin= g alias option"), + vshError(ctl, "alias '%s' of command '%s' has missing alia= s option", opt->name, cmd->name); - return -1; /* alias option must map to a later option name= */ + return -1; } } break; case VSH_OT_ARGV: if (cmd->opts[i + 1].name) { - vshError(ctl, _("parameter '%1$s' of command '%2$s' must b= e listed last"), + vshError(ctl, "parameter '%s' of command '%s' must be list= ed last", opt->name, cmd->name); - return -1; /* argv option must be listed last */ + return -1; } break; case VSH_OT_DATA: if (!(opt->flags & VSH_OFLAG_REQ)) { - vshError(ctl, _("parameter '%1$s' of command '%2$s' must u= se VSH_OFLAG_REQ flag"), + vshError(ctl, "parameter '%s' of command '%s' must use VSH= _OFLAG_REQ flag", opt->name, cmd->name); - return -1; /* OT_DATA should always be required. */ + return -1; } if (seenOptionalOption) { - vshError(ctl, _("parameter '%1$s' of command '%2$s' must b= e listed before optional parameters"), + vshError(ctl, "parameter '%s' of command '%s' must be list= ed before optional parameters", opt->name, cmd->name); - return -1; /* mandatory options must be listed first */ + return -1; } break; case VSH_OT_INT: if (opt->flags & VSH_OFLAG_REQ) { if (seenOptionalOption) { - vshError(ctl, _("parameter '%1$s' of command '%2$s' mu= st be listed before optional parameters"), + vshError(ctl, "parameter '%s' of command '%s' must be = listed before optional parameters", opt->name, cmd->name); - return -1; /* mandatory options must be listed first = */ + return -1; } } else { seenOptionalOption =3D true; --=20 2.44.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org