setopt ERR_EXIT PIPE_FAIL EXTENDED_GLOB GLOB_STAR_SHORT PERL=${PERL:-perl} EDITOR=${EDITOR:-vi} die() { print $@ >&2 exit 1 } [[ -d issues ]] || die You must run that command in directory with issues/ relpath() { $PERL -mFile::Spec -le "print File::Spec->abs2rel(@ARGV)" $1:a $2:a } endash() { $PERL -npe 's/(-+)/$1-/g ; s/ /-/g' } dedash() { $PERL -npe 's/([^-])-([^-])/$1 $2/g ; s/-(-+)/$1/g' } supercat() { cat ; } if [[ -z $NO_COLOR ]] && command -v spc > /dev/null 2> /dev/null ; then supercat() { spc $@ ; } fi delim() { { local i for i ({1..40}) print -n -- - print } | supercat -e mag,".*" }