Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

Fix 'compopt: command not found' on autocomplete on macOS

Danil Semelenovc0d18692047f
diff --git a/cmd/help.go b/cmd/help.go
index 865cc3ae8..b474a9c34 100644
--- a/cmd/help.go
+++ b/cmd/help.go
@@ -67,9 +67,9 @@ __rclone_custom_func() {
local reply=${prefix:+$prefix/}$line
[[ $reply != $path* ]] || COMPREPLY+=("$reply")
done < <(rclone lsf "${cur%%:*}:$prefix" 2>/dev/null)
- [[ ! ${COMPREPLY[@]} ]] || compopt -o filenames
+ [[ ! ${COMPREPLY[@]} || $(type -t compopt) != builtin ]] || compopt -o filenames
fi
- [[ ! ${COMPREPLY[@]} ]] || compopt -o nospace
+ [[ ! ${COMPREPLY[@]} || $(type -t compopt) != builtin ]] || compopt -o nospace
fi
}
`