aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xgist11
1 files changed, 11 insertions, 0 deletions
diff --git a/gist b/gist
index c93bb13..cf09f6f 100755
--- a/gist
+++ b/gist
@@ -762,6 +762,15 @@ _gists_with_languages() {
762 hint=false mark=${INPUT:+.} display=language _show_list | grep --color=always -Ei "$pattern" 762 hint=false mark=${INPUT:+.} display=language _show_list | grep --color=always -Ei "$pattern"
763} 763}
764 764
765_gists_with_range() {
766 [[ ! $@ =~ ^s*[0-9]*-s*[0-9]*$ ]] && echo 'Invalid range' && exit 1
767 local mark='' && [[ $@ =~ s ]] && mark=s
768
769 local range=$(sed -Ee "s/s//g; s/^-/1-/; s/-$/-$(wc -l <$INDEX)/; s/-/\n/" <<< "$*")
770 INPUT=$(seq $range | sed -e "s/^/p*$mark/")
771 hint=false _show_list
772}
773
765_apply_config "$@" || exit 1 774_apply_config "$@" || exit 1
766getConfiguredClient || exit 1 775getConfiguredClient || exit 1
767if [[ $init ]]; then _fetch_gists; exit 0; fi 776if [[ $init ]]; then _fetch_gists; exit 0; fi
@@ -816,6 +825,8 @@ case "$1" in
816 lan | l) 825 lan | l)
817 shift 826 shift
818 _gists_with_languages "$@" ;; 827 _gists_with_languages "$@" ;;
828 *-*)
829 _gists_with_range "$@" ;;
819 version) 830 version)
820 echo "Version $currentVersion" ;; 831 echo "Version $currentVersion" ;;
821 update) 832 update)