Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
In-snap bash tab completion #3150
Merged
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
85fd572
in-snap completion, pass 1
chipaca cd2573a
in-snap tab completion.
chipaca fe815e7
cleanup in isle 5 please.
chipaca c7bcad0
skip the twisted tests (they fail under travis)
chipaca 46ea55c
address review comments; some tweaks
chipaca b02ba90
address review feedback
chipaca 6dcbcde
some more filtering / validatiion
chipaca 8a60343
address review feedback, add a lot of comments :-), call shellcheck o…
chipaca a82ba0d
typo
chipaca 90a9b40
Merge branch 'master' into etelpmoc
chipaca 35d048a
fix for tests: debian does not have /snap/bin in secure_path so sudo
chipaca 7fc7cd7
Merge branch 'master' into etelpmoc
chipaca 41703e8
Merge branch 'master' into etelpmoc
chipaca e75170d
address issues from review
chipaca
Jump to file or symbol
Failed to load files and symbols.
Viewing a subset of changes. View all
some more filtering / validatiion
- Loading branch information...
commit 6dcbcded52192f57dedb980872e6ad22a84a93e8
chipaca
committed
Apr 26, 2017
chipaca
John Lenton
This commit was signed with a verified signature.
GPG key ID: 7A062ACAAAA170C2
Learn about signing commits
| @@ -41,7 +41,7 @@ _complete_from_snap() { | ||
| if [ ! "$bounced" ]; then | ||
| local IFS=$'\n' | ||
| - COMPREPLY=( $(cat) ) | ||
| + COMPREPLY=( $( \grep -v '[[:cntrl:];?*{}]' ) ) | ||
jdstrand
Contributor
|
||
| IFS="$oldIFS" | ||
| fi | ||
| @@ -62,7 +62,7 @@ _complete_from_snap() { | ||
| # what -D would've done before). | ||
| _complete_from_snap_maybe() { | ||
| # catch /snap/bin and /var/lib/snapd/snap/bin | ||
| - if [[ "$(which "$1")" =~ /snap/bin/ ]]; then | ||
| + if [[ "$(which "$1")" =~ /snap/bin/ && ( -e /var/lib/snapd/snap/core/current/usr/lib/snapd/etelpmoc.sh || -e /snap/core/current/usr/lib/snapd/etelpmoc.sh ) ]]; then | ||
| _complete_from_snap "$1" | ||
| return $? | ||
| fi | ||
Thanks for this! Note that shellcheck had this to say:
We use shellcheck for our shell scripts elsewhere and think adding this to run-checks for this and etelpmoc.sh would be a great idea.