From nobody Mon Feb 9 20:34:07 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 1711195146552442.51457867450256; Sat, 23 Mar 2024 04:59:06 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 4270D20EB; Sat, 23 Mar 2024 07:59:05 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 186081C2D; Sat, 23 Mar 2024 07:36:43 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id DDE801C12; Sat, 23 Mar 2024 07:36:35 -0400 (EDT) Received: from mx1.osci.io (polly.osci.io [8.43.85.229]) (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 9D6881C45 for ; Sat, 23 Mar 2024 07:32:53 -0400 (EDT) Received: by mx1.osci.io (Postfix, from userid 994) id 19BD0223E9; Fri, 22 Mar 2024 13:56:48 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by mx1.osci.io (Postfix) with ESMTPS id B0A8E223EC for ; Fri, 22 Mar 2024 13:56:47 -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-98-OgHW_49YOXS21iH9y1-XQw-1; Fri, 22 Mar 2024 13:56:45 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 4EEB43C0D7B6 for ; Fri, 22 Mar 2024 17:56:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBCE3492BD0 for ; Fri, 22 Mar 2024 17:56:44 +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.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: OgHW_49YOXS21iH9y1-XQw-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 27/35] vsh: Allow non-interactive use of 'cd' command Date: Fri, 22 Mar 2024 18:56:05 +0100 Message-ID: <466e7d249236bf3e31c3560ef9acf3ea6af4678a.1711129973.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: VLLCAPBYJTDZBEPZNCCL4PGBUKHUZMRB X-Message-ID-Hash: VLLCAPBYJTDZBEPZNCCL4PGBUKHUZMRB X-MailFrom: SRS0=Xa5W=K4=redhat.com=pkrempa@osci.io 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: 1711195147997100001 For testing purposes it will come handy to change the directory from a batch-mode script. Remove the check forbidding use of the 'cd' command in batch mode. Signed-off-by: Peter Krempa --- docs/manpages/virsh.rst | 2 -- tools/vsh.c | 5 ----- 2 files changed, 7 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 5cf510b6e9..a20a487d60 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -326,8 +326,6 @@ Will change current directory to *directory*. The defa= ult directory for the ``cd`` command is the home directory or, if there is no *HOME* variable in the environment, the root directory. -This command is only available in interactive mode. - pwd --- diff --git a/tools/vsh.c b/tools/vsh.c index f96071060a..de71b4af40 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -3171,11 +3171,6 @@ cmdCd(vshControl *ctl, const vshCmd *cmd) const char *dir =3D NULL; g_autofree char *dir_malloced =3D NULL; - if (!ctl->imode) { - vshError(ctl, "%s", _("cd: command valid only in interactive mode"= )); - return false; - } - if (vshCommandOptStringQuiet(ctl, cmd, "dir", &dir) <=3D 0) dir =3D dir_malloced =3D virGetUserDirectory(); if (!dir) --=20 2.44.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org