[PATCH 27/35] vsh: Allow non-interactive use of 'cd' command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <pkrempa@xxxxxxxxxx>
---
 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 default 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 = NULL;
     g_autofree char *dir_malloced = NULL;

-    if (!ctl->imode) {
-        vshError(ctl, "%s", _("cd: command valid only in interactive mode"));
-        return false;
-    }
-
     if (vshCommandOptStringQuiet(ctl, cmd, "dir", &dir) <= 0)
         dir = dir_malloced = virGetUserDirectory();
     if (!dir)
-- 
2.44.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux