From 6e3f5c441233629b48296a21a966346d13fc6782 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Thu, 27 Jun 2019 18:53:34 +0530 Subject: [PATCH] cephfs-shell: cd with no args shouldn't print an error message Instead the current working directory should change to root when no argument is passed to cd. Fixes: http://tracker.ceph.com/issues/40476 Signed-off-by: Rishabh Dave --- src/tools/cephfs/cephfs-shell | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 6d8c7388219..422d0495fb6 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -896,7 +896,8 @@ sub-directories, files') return self.complete_filenames(text, line, begidx, endidx) cd_parser = argparse.ArgumentParser(description='Change working directory') - cd_parser.add_argument('path', type=str, help='Name of the directory.', default='/') + cd_parser.add_argument('path', type=str, help='Name of the directory.', + nargs='?', default='/') @with_argparser(cd_parser) def do_cd(self, args): -- 2.39.5