<commit_before>#!/usr/bin/env bash

# parse options
#
for opt in $*; do
  case $opt in
    --cd-hack)
      RBFU_CD_HACK=1
      ;;
  esac
done    

# configure rbfu
# 
cat <<EOD
function rbfu () {
  eval "\`$HOME/.rbfu/libexec/rbfu-activate \$1\`"
}

[ -f $HOME/.rbfu-version ] && rbfu
EOD

# optional cd hack
#
if [ $RBFU_CD_HACK ]; then
  cat <<EOD
function cd() {
  if builtin cd "\$@"; then
    [ -f "\$PWD/.rbfu-version" ] && rbfu
  else
    return \$?
  fi
}
EOD
fi<commit_msg>Add bash completion for rbfu command<commit_after>#!/usr/bin/env bash

# parse options
#
for opt in $*; do
  case $opt in
    --cd-hack)
      RBFU_CD_HACK=1
      ;;
  esac
done    

# configure rbfu
# 
cat <<EOD
function rbfu () {
  eval "\`$HOME/.rbfu/libexec/rbfu-activate \$1\`"
}

[ -f $HOME/.rbfu-version ] && rbfu
EOD

# optional cd hack
#
if [ $RBFU_CD_HACK ]; then
  cat <<EOD
function cd() {
  if builtin cd "\$@"; then
    [ -f "\$PWD/.rbfu-version" ] && rbfu
  else
    return \$?
  fi
}
EOD
fi

# bash completion
#
_rbfu() {
  cur="${COMP_WORDS[COMP_CWORD]}"
  opts=$(ls $HOME/.rbfu/rubies)
  COMPREPLY=( $(compgen -W "${opts} system" -- ${cur}) )
}
complete -o nospace -F _rbfu rbfu

{'fraction_non_alphanumeric': 0.1785109983079526, 'fraction_numerical': 0.00338409475465313, 'mean_word_length': 2.5419161676646707, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, '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': '4676639', 'n_tokens_mistral': 541, 'n_tokens_neox': 529, 'n_words': 122}