From nobody Tue Sep 9 03:16:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1747750262; cv=none; d=zohomail.com; s=zohoarc; b=LC+Fjvlv8UrGbyed3dRWeOUJnY2Gyw4yXeP4dGRc+y13zWn6qHIzdLuPzeJ6QH1I/K+F7hCLff0L+rI2f4yM6/oLwFfmAtt8Bb0zYbTdPlqbD4BleHlhwqlK6T3XTVQqZdbQCjURkZ/hBXtRPIZON7wM32jLHBVHVm2y3ZlQ9bk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747750262; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=k+Ry3xoaoLZax8vGCaNufO8wTWifV7pdOpY8joPN284=; b=F3hcYQNFqmpJQxsMe12uB6736l8fXOFjRB+Ofm2Ra5k5XlC3gHSS1DxpiDRIGeG5QBlwdtGqyhp7TjhYmhv7N9c+vvBHx2fn0bNvdu7Why3Ut2erXNb3eSGQCS/Vxppv5TN5FQMP7n3T+x5+e5OI3pJSNIRlXgh9yHF59oZFjyw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1747750262129681.849523787952; Tue, 20 May 2025 07:11:02 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EF70F13FF; Tue, 20 May 2025 10:11:00 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 94A511896; Tue, 20 May 2025 10:10:15 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id ECDEC1321; Tue, 20 May 2025 10:10:10 -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 73AAB12AD for ; Tue, 20 May 2025 10:10:10 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-323-SQEDO0jnNoKi9DH-9cAo0g-1; Tue, 20 May 2025 10:10:08 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D97471850DF1 for ; Tue, 20 May 2025 14:08:58 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.37]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 182DD195608F for ; Tue, 20 May 2025 14:08:57 +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=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747750210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XHrueiYiaaYywOt52Oar6kWkCYIHD9L6Oi2M5GIvMds=; b=GLFj3/DUnMcVPJRWYkzaZhn7sRN7TfPffzvKz8xaQ1zgZ4IteQn5YSSBDEuEibspIk1+TL Ie4xNIZI9wpe+hF0Wn8kR82z0ZJWgFFlav1VFY6ETV4eWGAPQrsek8bBI1k33zjXq+/YGl e7YfCytgwk3WV3Iw1hVVrTg/ldG++VY= X-MC-Unique: SQEDO0jnNoKi9DH-9cAo0g-1 X-Mimecast-MFC-AGG-ID: SQEDO0jnNoKi9DH-9cAo0g_1747750207 To: devel@lists.libvirt.org Subject: [PATCH 2/4] vsh: Apply empty/local completers to global commands Date: Tue, 20 May 2025 16:08:51 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: vum-piMX6LtwBL6ORBJoV1sdi1C39w6Hh-9_tUjRu5Y_1747750207 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: A5N2ZX6Y3RXZRPA5SUDDQED75FXYVNY3 X-Message-ID-Hash: A5N2ZX6Y3RXZRPA5SUDDQED75FXYVNY3 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: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1747750263687116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Few outstanding arguments were not marked with completers completer despite the fact that we can't provide any reasonable suggestion (e.g 'echo' or 'complete' commands) or where we want to complete local path ( 'cd' ). Signed-off-by: Peter Krempa --- tools/vsh.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/vsh.c b/tools/vsh.c index d1e699505b..05845e2c1e 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -46,6 +46,8 @@ #include "virstring.h" #include "virutil.h" +#include "vsh-completer.h" + #ifdef WITH_READLINE /* For autocompletion */ vshControl *autoCompleteOpaque; @@ -3283,6 +3285,7 @@ const vshCmdOptDef opts_cd[] =3D { {.name =3D "dir", .type =3D VSH_OT_STRING, .positional =3D true, + .completer =3D vshCompletePathLocalExisting, .help =3D N_("directory to switch to (default: home or else root)") }, {.name =3D NULL} @@ -3340,11 +3343,13 @@ const vshCmdOptDef opts_echo[] =3D { }, {.name =3D "prefix", .type =3D VSH_OT_STRING, + .completer =3D vshCompleteEmpty, .help =3D N_("prefix the message") }, {.name =3D "string", .type =3D VSH_OT_ARGV, .positional =3D true, + .completer =3D vshCompleteEmpty, .help =3D N_("arguments to echo") }, {.name =3D NULL} @@ -3491,6 +3496,7 @@ const vshCmdOptDef opts_complete[] =3D { .type =3D VSH_OT_ARGV, .positional =3D true, .allowEmpty =3D true, + .completer =3D vshCompleteEmpty, .help =3D N_("partial string to autocomplete") }, {.name =3D NULL} --=20 2.49.0