From df4031c67b8299dca2a3a831c4dc02073f6ea1d3 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Wed, 5 May 2021 17:41:51 +0800 Subject: Add sub-commands to get id and url --- gist | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gist b/gist index c4788c0..13154b2 100755 --- a/gist +++ b/gist @@ -34,6 +34,8 @@ # config, c [value] Configure a single option. If no value is specified, apply default setting # user, u Get list of gists with a given Github user # github, G Export selected gist as a new Github repo +# id Print the gist ID +# url Print the gist URL # help, h Show this help message # # Example: @@ -887,6 +889,12 @@ case "$1" in detail | d) shift _show_detail "$@" ;; + id) + shift + _set_gist_id "$1" && echo ${GIST_ID} ;; + url) + shift + _set_gist_id "$1" && echo https://gist.github.com/${GIST_ID} ;; delete | D) shift _delete_gist "$@" ;; -- cgit v1.2.3-70-g09d2