mirror of
https://opendev.org/openstack/openstack-ansible.git
synced 2026-01-11 20:07:20 +00:00
Ensure bash-completion also search for .yaml
Auto-complete ignores playbooks having .yaml extension, which might be a good chunk of third-party playbooks. Let's ensure we cover them as well. Change-Id: If995d702ea58c4251b655ba2c3043dbf4f14e671 Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
This commit is contained in:
parent
4f7c175803
commit
5fe6f2987b
1 changed files with 2 additions and 1 deletions
|
|
@ -42,6 +42,7 @@ _normalize_collection_playbook_paths(){
|
|||
|
||||
# Remove ".yml" extension (if present)
|
||||
path=${path%.yml}
|
||||
path=${path%.yaml}
|
||||
|
||||
# Replace slashes with dots
|
||||
path=${path//\//.}
|
||||
|
|
@ -83,7 +84,7 @@ _openstack_ansible() {
|
|||
elif [[ "$prev" == "-l" ]] || [[ "$prev" == "--limit" ]]; then
|
||||
completions=$(_ansible_hosts_inventory | grep -i "${cur}")
|
||||
else
|
||||
playbooks=$(find ${COLLECTION_PATH} -type f -name "*.yml" | grep playbooks)
|
||||
playbooks=$(find ${COLLECTION_PATH} -type f \( -name "*.yml" -o -name "*.yaml" \) | grep playbooks)
|
||||
completions=$(_normalize_collection_playbook_paths ${playbooks[@]} | grep -i "${cur}")
|
||||
fi
|
||||
COMPREPLY=($(compgen -W '${completions}' -- ${cur}))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue