Skip to content

Commit

Permalink
Add a bolt task to setup shell completion
Browse files Browse the repository at this point in the history
This is a building block that might be used when/if we want to add Bolt
tasks / plans to setup Choria on nodes not managed by Puppet, in
particular client nodes.

Currently our systems administrator manually add the choria repo and
install the software, but this is not enough to have shell completion
and we might need to update it from time to time.

Add a bolt task that make managing the completions easier:

```
bolt task run choria::completion -t localhost --run-as root
```
  • Loading branch information
smortex committed Dec 9, 2021
1 parent d036bb0 commit 72d870b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/completion.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"description": "Setup choria completion"
}
11 changes: 11 additions & 0 deletions tasks/completion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
for p in /usr/share/bash-completion /usr/local/etc/bash_completion.d; do
if [ -d "$p" ]; then
choria completion --bash > "$p/choria"
fi
done
for p in /usr/share/zsh/vendor-completions /usr/local/share/zsh/site-functions; do
if [ -d "$p" ]; then
choria completion --zsh > "$p/_choria"
fi
done

0 comments on commit 72d870b

Please sign in to comment.