-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kontena): add fallback 3rd-party completion loader
https://github.com/kontena/kontena https://github.com/kontena/docs/blob/2c87feaf363aa7fd5badc296d5c146dbb89a3c8e/quick-start.md#linux--windows https://github.com/ohmybash/oh-my-bash/blob/b4a2264496e14f883101ec15e35607b2e7386acc/completions/kontena.completion.sh
- Loading branch information
1 parent
dea7e1d
commit 5eef0ce
Showing
4 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,6 +216,7 @@ bashcomp_DATA = 2to3 \ | |
kldload \ | ||
kldunload \ | ||
koji \ | ||
_kontena \ | ||
ktutil \ | ||
larch \ | ||
lastlog \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 3rd party completion loader for kontena -*- shell-script -*- | ||
# | ||
# This serves as a fallback in case the completion is not installed otherwise. | ||
|
||
# To avoid sourcing an empty string with `. "$(...)"` on failing to obtain the | ||
# path, we assign the output to a variable `_comp_cmd_kontena__completion_path` | ||
# and test it before sourcing. The variable is removed on successful loading | ||
# but left on a failure for the debugging purpose. | ||
_comp_cmd_kontena__completion_path=$("$1" whoami --bash-completion-path 2>/dev/null) && | ||
[[ -r $_comp_cmd_kontena__completion_path ]] && | ||
. "$_comp_cmd_kontena__completion_path" && | ||
unset -v _comp_cmd_kontena__completion_path | ||
|
||
# ex: filetype=sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ EXTRA_DIST = \ | |
hwclock \ | ||
ionice \ | ||
keyring \ | ||
kontena \ | ||
look \ | ||
mdbook \ | ||
mock \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../completions/_kontena |