aboutsummaryrefslogtreecommitdiffstats
path: root/src/_gist
diff options
context:
space:
mode:
authorShohei YOSHIDA <syohex@gmail.com>2022-11-11 11:46:54 +0900
committerShohei YOSHIDA <syohex@gmail.com>2022-11-11 11:46:54 +0900
commitd45e52f60719c21463460e4181a6cb8920b6a574 (patch)
treea25df266a930c82d52595eca7be8a231102ae26f /src/_gist
parentMerge pull request #909 from zsh-users/update-cppcheck (diff)
downloadzsh-completions-d45e52f60719c21463460e4181a6cb8920b6a574.tar
zsh-completions-d45e52f60719c21463460e4181a6cb8920b6a574.tar.gz
zsh-completions-d45e52f60719c21463460e4181a6cb8920b6a574.tar.bz2
zsh-completions-d45e52f60719c21463460e4181a6cb8920b6a574.tar.lz
zsh-completions-d45e52f60719c21463460e4181a6cb8920b6a574.tar.xz
zsh-completions-d45e52f60719c21463460e4181a6cb8920b6a574.tar.zst
zsh-completions-d45e52f60719c21463460e4181a6cb8920b6a574.zip
Update gist completion
Diffstat (limited to 'src/_gist')
-rw-r--r--src/_gist26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/_gist b/src/_gist
index b105a56..1db566e 100644
--- a/src/_gist
+++ b/src/_gist
@@ -1,6 +1,6 @@
#compdef gist
# ------------------------------------------------------------------------------
-# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
+# Copyright (c) 2017 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -39,9 +39,6 @@
# * Shivam Mehta <https://github.com/maniac-en>
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
@@ -50,17 +47,18 @@ _arguments -C \
'(--login)--login[Authenticate gist on this computer.]' \
'(-f --filename)'{-f,--filename}'[Sets the filename and syntax type.]:NAME' \
'(-t --type)'{-t,--type}'[Sets the file extension and syntax type.]:EXT' \
- '(-p --private)'{-p,--private}'[Makes your gist private.]' \
- '(--no-private)'--no-private'[Makes your gist no private.]' \
+ '(-p --private --no-private)'{-p,--private}'[Makes your gist private.]' \
+ '(--no-private -p --private)'--no-private'[Makes your gist no private.]' \
'(-d --description)'{-d,--description}'[Adds a description to your gist.]:DESCRIPTION' \
'(-s --shorten)'{-s,--shorten}'[Shorten the gist URL using git.io.]' \
'(-u --update)'{-u,--update}'[Update an existing gist.]:URL ID:user_gists' \
- '(-a --anonymous)'{-a,--anonymous}'[Create an anonymous gist.]' \
'(-c --copy)'{-c,--copy}'[Copy the resulting URL to the clipboard]' \
'(-e --embed)'{-e,--embed}'[Copy the embed code for the gist to the clipboard]' \
- '(-o --open)'{-o,--open}'[Open the resulting URL in a browser]' \
- '(--no-open)'--no-open'[No open the resulting URL in a browser]' \
+ '(-o --open --no-open)'{-o,--open}'[Open the resulting URL in a browser]' \
+ '(--no-open -o --open)'--no-open'[No open the resulting URL in a browser]' \
'(-P --paste)'{-P,--paste}'[Paste from the clipboard to gist]' \
+ '(-R --raw)'{-R,--raw}'[Display raw URL of the new gist]' \
+ '(-l --list)'{-l,--list}'[List all gists for user ]::user' \
'(-h --help)'{-h,--help}'[print options help]' \
'(-v --version)'{-v,--version}'[print version]' \
'(-r --read)'{-r,--read}'[Read a gist and print out the contents]:user gists:user_gists' \
@@ -103,7 +101,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}}')"
@@ -118,3 +116,11 @@ user_gists() {
}
return ret
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et