Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompletion script wrongly generated (at least) for bash if using path to call scw #3676

Closed
mid1221213 opened this issue Feb 22, 2024 · 1 comment · Fixed by #3829
Closed
Assignees

Comments

@mid1221213
Copy link

…because the basename of binaryName should be extracted. In the following test, scw is called with full path, resulting in wrongly named bash function:

$ ~/bin/scw autocomplete script shell=bash
_/home/mid/bin/scw() {
	_get_comp_words_by_ref -n = cword words

	output=$(/home/mid/bin/scw autocomplete complete bash -- "$COMP_LINE" "$cword" "${words[@]}")
	COMPREPLY=($output)
	# apply compopt option and ignore failure for older bash versions
	[[ $COMPREPLY == *= ]] && compopt -o nospace 2> /dev/null || true
	return
}
complete -F _/home/mid/bin/scw /home/mid/bin/scw

😉

@Codelax
Copy link
Member

Codelax commented Feb 26, 2024

Similar to #1959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants