<commit_before>
alias rg "rg -i --sort-files"
alias rg_ "rg --no-heading --no-filename --no-line-number"

function ff
  set -l flags
  if test -n "$argv"
      and test $argv[1] = "-u" # -u belongs to first rg
      set flags $argv[1]
      set -e argv[1]
  end

  set -l pattern "^"
  if test -n "$argv"
    set pattern $argv
  end

  rg --files --follow $flags | rg $pattern
end

alias ffu "ff -u"

function fne
  ff "\\.$argv[1]\$"
end
<commit_msg>Refactor ff with argparse #fish<commit_after>
alias rg "rg -i --sort-files"
alias rg_ "rg --no-heading --no-filename --no-line-number"

function ff
  set -l flags

  argparse u/unrestricted -- $argv
  or return

  # --unrestricted
  if set -q _flag_unrestricted
      set flags "-u"
  end

  if test -z "$argv"
    rg --files --follow $flags
  else
    rg --files --follow $flags | rg $argv
  end
end

function fne
  ff "\\.$argv[1]\$"
end

{'fraction_non_alphanumeric': 0.14590347923681257, 'fraction_numerical': 0.005611672278338945, 'mean_word_length': 2.2318840579710146, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2348895', 'n_tokens_mistral': 359, 'n_tokens_neox': 329, 'n_words': 121}