Skip to content

Commit 72d870b

Browse files
committed
Add a bolt task to setup shell completion
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 ```
1 parent d036bb0 commit 72d870b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tasks/completion.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"description": "Setup choria completion"
3+
}

tasks/completion.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
for p in /usr/share/bash-completion /usr/local/etc/bash_completion.d; do
3+
if [ -d "$p" ]; then
4+
choria completion --bash > "$p/choria"
5+
fi
6+
done
7+
for p in /usr/share/zsh/vendor-completions /usr/local/share/zsh/site-functions; do
8+
if [ -d "$p" ]; then
9+
choria completion --zsh > "$p/_choria"
10+
fi
11+
done

0 commit comments

Comments
 (0)