Skip to content

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

Closed
@mid1221213

Description

@mid1221213

…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

😉

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions