From c0d18692047f36b814957fb5a281c438e833e202 Mon Sep 17 00:00:00 2001 From: Danil Semelenov Date: Wed, 4 Sep 2019 12:04:43 +0300 Subject: [PATCH] Fix 'compopt: command not found' on autocomplete on macOS As reported in #3489. --- cmd/help.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 } `