diff options
author | Hsieh Chin Fan <typebrook@gmail.com> | 2021-05-05 17:41:51 +0800 |
---|---|---|
committer | Hsieh Chin Fan <typebrook@gmail.com> | 2021-05-05 17:41:51 +0800 |
commit | df4031c67b8299dca2a3a831c4dc02073f6ea1d3 (patch) | |
tree | ef00551ad85c367c7b238fb3740c99a1634f4238 | |
parent | c08d6737f1537122843d80fb515bbf259ed79108 (diff) |
Add sub-commands to get id and url
-rwxr-xr-x | gist | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -34,6 +34,8 @@ | |||
34 | # config, c <VALID_KEY> [value] Configure a single option. If no value is specified, apply default setting | 34 | # config, c <VALID_KEY> [value] Configure a single option. If no value is specified, apply default setting |
35 | # user, u <USER> Get list of gists with a given Github user | 35 | # user, u <USER> Get list of gists with a given Github user |
36 | # github, G <INDEX> Export selected gist as a new Github repo | 36 | # github, G <INDEX> Export selected gist as a new Github repo |
37 | # id <INDEX> Print the gist ID | ||
38 | # url <INDEX> Print the gist URL | ||
37 | # help, h Show this help message | 39 | # help, h Show this help message |
38 | # | 40 | # |
39 | # Example: | 41 | # Example: |
@@ -887,6 +889,12 @@ case "$1" in | |||
887 | detail | d) | 889 | detail | d) |
888 | shift | 890 | shift |
889 | _show_detail "$@" ;; | 891 | _show_detail "$@" ;; |
892 | id) | ||
893 | shift | ||
894 | _set_gist_id "$1" && echo ${GIST_ID} ;; | ||
895 | url) | ||
896 | shift | ||
897 | _set_gist_id "$1" && echo https://gist.github.com/${GIST_ID} ;; | ||
890 | delete | D) | 898 | delete | D) |
891 | shift | 899 | shift |
892 | _delete_gist "$@" ;; | 900 | _delete_gist "$@" ;; |