<commit_before>config:default() (
  echo --help
)

config:usage() (
  echo "$app [<$app-opts>] $cmd <key> [<value>]"
)

config:options() (
  echo "f,file=   Config file to use"
  echo "l,local   Use './.bpan/config'"
  echo "g,global  Use '\$BPAN_ROOT/config'"
  echo "all       Get all values for a key"
  echo "list      List all keys and values"
)

config:main() (
  opts=()

  if [[ ${option_file-} ]]; then
    opts+=(--file="$option_file")
  elif $option_local; then
    git:assert-in-repo
    opts+=(--file="$(git:top-dir)"/.bpan/config)
  elif $option_global; then
    git:assert-in-repo
    opts+=(--file="$root"/config)
  fi

  if $option_list; then
    ini:list "${opts[@]}"
  elif [[ $# -eq 1 ]]; then
    ini:get "${opts[@]}" "$@"
  elif [[ $# -eq 2 ]]; then
    ini:set "${opts[@]}" "$@"
  fi
)
<commit_msg>Fix bug with 'bpan config --global'<commit_after>config:default() (
  echo --help
)

config:usage() (
  echo "$app [<$app-opts>] $cmd <key> [<value>]"
)

config:options() (
  echo "f,file=   Config file to use"
  echo "l,local   Use './.bpan/config'"
  echo "g,global  Use '\$BPAN_ROOT/config'"
  echo "all       Get all values for a key"
  echo "list      List all keys and values"
)

config:main() (
  opts=()

  if [[ ${option_file-} ]]; then
    opts+=(--file="$option_file")
  elif $option_local; then
    git:in-repo || error \
      "'bpan config --local' can only be used inside a BPAN package repo"
    opts+=(--file="$(git:top-dir)"/.bpan/config)
  elif $option_global; then
    opts+=(--file="$root"/config)
  fi

  if $option_list; then
    ini:list "${opts[@]}"
  elif [[ $# -eq 1 ]]; then
    ini:get "${opts[@]}" "$@"
  elif [[ $# -eq 2 ]]; then
    ini:set "${opts[@]}" "$@"
  fi
)

{'fraction_non_alphanumeric': 0.2134962187318208, 'fraction_numerical': 0.002326934264107039, 'mean_word_length': 2.9631336405529956, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6461796', 'n_tokens_mistral': 677, 'n_tokens_neox': 645, 'n_words': 167}