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'
23 # Usage: colourise ColourSpec:RegExp [ColourSpec:RegExp ...]
24 # It is intended to be a drop-in replacement for supercat utility.
25 # ColourSpec is comma delimited list of ANSI codes for colour setting.
26 # Look for zsh'es Functions/Misc/colors documentation about possible
27 # colour values. For example to set bold red on green background you use
28 # "bold,fg-red,bg-green" as a ColourSpec.
29 # RegExp is POSIX extended regular expression of the text you want to
32 if [[ -n $NO_COLOR ]] || [[ $# -eq 0 ]] ; then
36 (( ${+colour} )) || { autoload -Uz colors ; colors ; }
37 local lc=$'\e[' rc=m colr=""
38 local spec=(${(s/:/)1})
40 for c (${(s/,/)${spec[1]}}) colr="${col}${lc}${colour[$c]}${rc}"
41 local re=${(j/:/)spec[2,-1]}
42 sed -E "s/${re}/${colr}&${reset_color}/g" | colourise $@
48 for i ({1..40}) print -n -- -
50 } | colourise magenta:".*"