Skip to content

Commit 2117ee5

Browse files
authored
feat(molecule): introduce molecule plugin (ohmyzsh#12760)
1 parent 7f8d6b1 commit 2117ee5

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

plugins/molecule/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Molecule plugin
2+
3+
This plugin adds completion for [Molecule](https://ansible.readthedocs.io/projects/molecule/), the project designed to aid in the development and testing of Ansible roles..
4+
5+
To use it, add `molecule` to the plugins array in your zshrc file:
6+
7+
```zsh
8+
plugins=(... molecule)
9+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Completion
2+
if (( ! $+commands[molecule] )); then
3+
return
4+
fi
5+
6+
# If the completion file doesn't exist yet, we need to autoload it and
7+
# bind it to `molecule`. Otherwise, compinit will have already done that.
8+
if [[ ! -f "$ZSH_CACHE_DIR/completions/_molecule" ]]; then
9+
typeset -g -A _comps
10+
autoload -Uz _molecule
11+
_comps[molecule]=_molecule
12+
fi
13+
14+
_MOLECULE_COMPLETE=zsh_source molecule >| "$ZSH_CACHE_DIR/completions/_molecule" &|

0 commit comments

Comments
 (0)