aboutsummaryrefslogtreecommitdiffstats
path: root/src/_gist
diff options
context:
space:
mode:
authorpatrick96 <p.ziegler96@gmail.com>2017-04-02 20:57:12 +0200
committerpatrick96 <p.ziegler96@gmail.com>2017-04-02 20:57:12 +0200
commitdf5a3a1b6c1af11d507a3f5a5fba58b66f09a199 (patch)
treea5e4d0298473593b3cee08b1e6e4be8bc4b723c1 /src/_gist
parentAdd gist completion for read flag (diff)
downloadzsh-completions-df5a3a1b6c1af11d507a3f5a5fba58b66f09a199.tar
zsh-completions-df5a3a1b6c1af11d507a3f5a5fba58b66f09a199.tar.gz
zsh-completions-df5a3a1b6c1af11d507a3f5a5fba58b66f09a199.tar.bz2
zsh-completions-df5a3a1b6c1af11d507a3f5a5fba58b66f09a199.tar.lz
zsh-completions-df5a3a1b6c1af11d507a3f5a5fba58b66f09a199.tar.xz
zsh-completions-df5a3a1b6c1af11d507a3f5a5fba58b66f09a199.tar.zst
zsh-completions-df5a3a1b6c1af11d507a3f5a5fba58b66f09a199.zip
Try to follow the style guide
Diffstat (limited to 'src/_gist')
-rw-r--r--src/_gist14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/_gist b/src/_gist
index 8366a9b..03fa196 100644
--- a/src/_gist
+++ b/src/_gist
@@ -75,21 +75,23 @@ _user_gists_cache_policy() {
user_gists() {
local update_policy ret=1
zstyle -s ":completion:${curcontext}:" cache-policy update_policy
- [[ -z "$update_policy" ]] && zstyle ":completion:${curcontext}:" cache-policy _user_gists_cache_policy
+ if [[ -z "$update_policy" ]]; then
+ zstyle ":completion:${curcontext}:" cache-policy _user_gists_cache_policy
+ fi
- # Stores the gists of the logged in user in the format ID[Description]
+ # stores the gists of the logged in user in the format ID[Description]
_list=()
_cached_gists="user_gists"
- # Retrieve/Write gists from/to cache
+ # retrieve/Write gists from/to cache
if _cache_invalid $_cached_gists || ! _retrieve_cache $_cached_gists; then
_gists=$(gist -l)
if [ $? -eq 0 ]; then
_store_cache $_cached_gists _gists
else
- # Some error occurred, the user is probably not logged in
- # Set _gists to an empty string so that no completion is attempted
+ # some error occurred, the user is probably not logged in
+ # set _gists to an empty string so that no completion is attempted
_gists=""
fi
else
@@ -100,7 +102,7 @@ user_gists() {
echo "$_gists" | while read -r line; do
# Splitting the gist -l output
url="$(echo "$line" | cut -d " " -f 1 | cut -d "/" -f 4)"
- # Gists w/o descriptions can have only one column in the output, those
+ # gists w/o descriptions can have only one column in the output, those
# have their description set to an empty string
description="$(echo "$line" | awk '{if(NF > 1){$1=""; print $0}}')"