diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion
index 95d3e1e..a18713f 100644
--- a/src/completion/pass.bash-completion
+++ b/src/completion/pass.bash-completion
@@ -54,7 +54,7 @@ _pass_complete_entries () {
 	# The only time we want to add a space to the end is if there is only
 	# one match, and it is not a directory
 	if [[ $i -gt 1 || ( $i -eq 1 && -d $firstitem ) ]]; then
-		compopt -o nospace
+		type compopt >/dev/null 2>&1 && compopt -o nospace
 	fi
 }
 
@@ -91,7 +91,7 @@ _pass()
 			init)
 				if [[ $lastarg == "-p" || $lastarg == "--path" ]]; then
 					_pass_complete_folders
-					compopt -o nospace
+					type compopt >/dev/null 2>&1 && compopt -o nospace
 				else
 					COMPREPLY+=($(compgen -W "-p --path" -- ${cur}))
 					_pass_complete_keys
