<commit_before>#!/usr/bin/env zsh
# vim: ts=2 sts=2 sw=2 et fdm=marker cms=\ #\ %s

setopt extended_glob
setopt errreturn
setopt no_unset
setopt warn_create_global

function usage # {{{
{
  local self="$_SELF" exit=${1?} fd=1
  shift
  test $exit -ne 0 && fd=2
  {
    if (( exit == 1 )); then
      print -f "%s: option -%c requires an argument\n" -- "$self" "$1"
    elif (( exit == 2 )); then
      print -f "%s: unknown option -%s\n" -- "$self" "$1"
    elif (( exit == 3 )); then
      print -f "%s: missing operand\n" -- "$self"
    fi
    print -f "%s: Usage: %s {-h|[options] BASE HEAD}\n" -- "$self" "$self"
    if (( exit != 0 )); then
      print -f "%s: Use \"%s -h\" to see the full option listing.\n" -- "$self" "$self"
    else
      print -f "  Options:\n"
      print -f "    %-20s  %s\n" -- \
        "-h"              "Display this message" \
        "--cc ADDR"       "Include ADDR in Cc: header" \
        "-n"              "Do not send emails, preserve files" \
        "-o,--output DIR" "Write files to DIR" \
        "--to ADDR"       "Include ADDR in To: header" \

    fi
  } >&$fd
  exit $(( exit != 0 ))
} # }}}

function o # {{{
{
  declare -i dryrun=0
  if [[ $1 == -n ]]; then
    shift
    dryrun=1
  fi
  if (( $+GIT_PIMP_CHATTY )); then
    if [[ "${(@j,%,)@}" == $~GIT_PIMP_CHATTY ]]; then
      print -u 2 "${(j: :)${(@q-)@}}"
    fi
  fi
  if (( $+GIT_PIMP_DRYRUN )); then
    if [[ "${(@j,%,)@}" == $~GIT_PIMP_DRYRUN ]]; then
      dryrun=1<commit_msg>zsh bc: avoid the 'q-' parameter expansion flag<commit_after>#!/usr/bin/env zsh
# vim: ts=2 sts=2 sw=2 et fdm=marker cms=\ #\ %s

setopt extended_glob
setopt errreturn
setopt no_unset
setopt warn_create_global

function usage # {{{
{
  local self="$_SELF" exit=${1?} fd=1
  shift
  test $exit -ne 0 && fd=2
  {
    if (( exit == 1 )); then
      print -f "%s: option -%c requires an argument\n" -- "$self" "$1"
    elif (( exit == 2 )); then
      print -f "%s: unknown option -%s\n" -- "$self" "$1"
    elif (( exit == 3 )); then
      print -f "%s: missing operand\n" -- "$self"
    fi
    print -f "%s: Usage: %s {-h|[options] BASE HEAD}\n" -- "$self" "$self"
    if (( exit != 0 )); then
      print -f "%s: Use \"%s -h\" to see the full option listing.\n" -- "$self" "$self"
    else
      print -f "  Options:\n"
      print -f "    %-20s  %s\n" -- \
        "-h"              "Display this message" \
        "--cc ADDR"       "Include ADDR in Cc: header" \
        "-n"              "Do not send emails, preserve files" \
        "-o,--output DIR" "Write files to DIR" \
        "--to ADDR"       "Include ADDR in To: header" \

    fi
  } >&$fd
  exit $(( exit != 0 ))
} # }}}

function o # {{{
{
  declare -i dryrun=0
  if [[ $1 == -n ]]; then
    shift
    dryrun=1
  fi
  if (( $+GIT_PIMP_CHATTY )); then
    if [[ "${(@j,%,)@}" == $~GIT_PIMP_CHATTY ]]; then
      print -u 2 "${(qj: :)@}"
    fi
  fi
  if (( $+GIT_PIMP_DRYRUN )); then
    if [[ "${(@j,%,)@}" == $~GIT_PIMP_DRYRUN ]]; then
      dryrun=1
{'fraction_non_alphanumeric': 0.2085134685733289, 'fraction_numerical': 0.013967409378117725, 'mean_word_length': 1.99601593625498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1008577', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1174, 'n_words': 351}