diff options
| -rwxr-xr-x | gist | 11 |
1 files changed, 11 insertions, 0 deletions
| @@ -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 |
| 766 | getConfiguredClient || exit 1 | 775 | getConfiguredClient || exit 1 |
| 767 | if [[ $init ]]; then _fetch_gists; exit 0; fi | 776 | if [[ $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) |