From 2e80d4c18edabf33755c6827d900a48c8c2d056a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabian=20M=C3=B6ller?= <fabianm88@gmail.com>
Date: Tue, 31 Jul 2018 12:34:59 +0200
Subject: [PATCH] vfs: update vfs/refresh rc command documentation

---
 vfs/dir.go |  4 ++++
 vfs/rc.go  | 15 +++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/vfs/dir.go b/vfs/dir.go
index e1d92d0e8..16084b833 100644
--- a/vfs/dir.go
+++ b/vfs/dir.go
@@ -197,10 +197,14 @@ func (d *Dir) _readDir() error {
 	return nil
 }
 
+// update d.items for each dir in the DirTree below this one and
+// set the last read time - must be called with the lock held
 func (d *Dir) _readDirFromDirTree(dirTree walk.DirTree, when time.Time) error {
 	return d._readDirFromEntries(dirTree[d.path], dirTree, when)
 }
 
+// update d.items and if dirTree is not nil update each dir in the DirTree below this one and
+// set the last read time - must be called with the lock held
 func (d *Dir) _readDirFromEntries(entries fs.DirEntries, dirTree walk.DirTree, when time.Time) error {
 	var err error
 	// Cache the items by name
diff --git a/vfs/rc.go b/vfs/rc.go
index 0d5a5a12d..bfe47fe32 100644
--- a/vfs/rc.go
+++ b/vfs/rc.go
@@ -1,6 +1,7 @@
 package vfs
 
 import (
+	"strconv"
 	"strings"
 
 	"github.com/ncw/rclone/fs"
@@ -95,11 +96,8 @@ starting with dir will forget that dir, eg
 					if !ok {
 						return out, errors.Errorf("value must be string %q=%v", k, v)
 					}
-					switch strings.ToLower(s) {
-					case "true", "1":
-						recursive = true
-					case "false", "0":
-					default:
+					recursive, err = strconv.ParseBool(s)
+					if err != nil {
 						return out, errors.Errorf("invalid value %q=%v", k, v)
 					}
 					delete(in, k)
@@ -151,9 +149,9 @@ starting with dir will forget that dir, eg
 			}
 			return out, nil
 		},
-		Title: "Refresh the directory cache tree.",
+		Title: "Refresh the directory cache.",
 		Help: `
-This reads the full directory tree for the paths and freshens the
+This reads the directories for the specified paths and freshens the
 directory cache.
 
 If no paths are passed in then it will refresh the root directory.
@@ -165,7 +163,8 @@ starting with dir will refresh that directory, eg
 
     rclone rc vfs/refresh dir=home/junk dir2=data/misc
 
-This refresh will use --fast-list if enabled.
+If the parameter recursive=true is given the whole directory tree
+will get refreshed. This refresh will use --fast-list if enabled.
 
 `,
 	})