1 setopt ERR_EXIT PIPE_FAIL EXTENDED_GLOB GLOB_STAR_SHORT
11 [[ -d issues ]] || die You must run that command in directory with issues/
16 $PERL -npe 's/(-+)/$1-/g ; s/ /-/g'
20 $PERL -npe 's/([^-])-([^-])/$1 $2/g ; s/-(-+)/$1/g'
24 local cols=(${(s/-/)1})
25 REPLY=("${cols[1]}-${cols[2]}-${cols[3]:s/T/ /}" ${(j/-/)cols[4,-1]})
28 # Usage: colourise ColourSpec:RegExp [ColourSpec:RegExp ...]
29 # It is intended to be a drop-in replacement for supercat utility.
30 # ColourSpec is comma delimited list of ANSI codes for colour setting.
31 # Look for zsh'es Functions/Misc/colors documentation about possible
32 # colour values. For example to set bold red on green background you use
33 # "bold,fg-red,bg-green" as a ColourSpec.
34 # RegExp is POSIX extended regular expression of the text you want to
37 if [[ -n $NO_COLOR ]] || [[ $# -eq 0 ]] ; then
41 (( ${+colour} )) || { autoload -Uz colors ; colors ; }
42 local lc=$'\e[' rc=m colr=""
43 local spec=(${(s/:/)1})
45 for c (${(s/,/)${spec[1]}}) colr="${col}${lc}${colour[$c]}${rc}"
46 local re=${(j/:/)spec[2,-1]}
47 sed -E "s/${re}/${colr}&${reset_color}/g" | colourise $@
53 for i ({1..40}) print -n -- -
55 } | colourise magenta:".*"