<commit_before>function __omf.packages.sort
  for package in (echo $argv | tr ' ' '\n' | sort); echo $package; end
end

function __omf.packages.builtin
  echo "omf"
end

function __omf.packages.list -a type
  set -l list

  test "$type" = "--theme"; or for package in (basename -a {$OMF_CONFIG,$OMF_PATH/db}/pkg/*)
    contains $package (__omf.packages.builtin); or set list $list $package
  end

  test "$type" = "--plugin"; or for package in (basename -a {$OMF_CONFIG,$OMF_PATH/db}/themes/*)
    set list $list $package
  end

  __omf.packages.sort $list
end

function __omf.packages.list.available -a type
  set -l list

  test "$type" = "--theme"; or for package in (basename -a $OMF_PATH/db/pkg/*)
    contains $package (basename -a {$OMF_CONFIG,$OMF_PATH}/pkg/*); or set list $list $package
  end

  test "$type" = "--plugin"; or for package in (basename -a $OMF_PATH/db/themes/*)
    contains $package (basename -a {$OMF_CONFIG,$OMF_PATH}/themes/*); or set list $list $package
  end

  __omf.packages.sort $list
end

function __omf.packages.list.database -a type
  set -l list

  test "$type" = "--theme"; or for package in (basename -a $OMF_PATH/db/pkg/*)
    set list $list $package
  end

  test "$type" = "--plugin"; or for package in (basename -a $OMF_PATH/db/themes/*)
    set list $list $package
  end

  __omf.packages.sort $list
end

function __omf.packages.list.installed -a type
  set -l list

  test "$type" = "--theme"; or for package in (basename -a {$OMF_CONFIG,$OMF_PATH}/pkg/*)
    contains $package (__omf.packages.builtin); or set list $list $package
  end

  test "$type" = "--plugin"; or for package in (basename -a {$OMF_CONFIG,$OMF_PATH}/themes/*)
    set list $list $package
  end

  __omf.packages.sort $list
end

function omf.packages.list -a option type
  switch "$option"
  case "--available"
    __omf.packages.list.available $type
  case "--database"
    __omf.packages.list.database $type
  case "--installed"
    __omf.packages.list.installed $type
  case "*"
    __omf.packages.list $type
  end
end
<commit_msg>Suppress basename usage output<commit_after>function __omf.packages.sort
  for package in (echo $argv | tr ' ' '\n' | sort); echo $package; end
end

function __omf.packages.builtin
  echo "omf"
end

function __omf.packages.list -a type
  set -l list

  test "$type" = "--theme"; or for package in (basename -a {$OMF_CONFIG,$OMF_PATH/db}/pkg/*)
    contains $package (__omf.packages.builtin); or set list $list $package
  end

  test "$type" = "--plugin"; or for package in (basename -a {$OMF_CONFIG,$OMF_PATH/db}/themes/*)
    set list $list $package
  end

  __omf.packages.sort $list
end

function __omf.packages.list.available -a type
  set -l list

  test "$type" = "--theme"; or for package in (basename -a $OMF_PATH/db/pkg/*)
    contains $package (basename -a {$OMF_CONFIG,$OMF_PATH}/pkg/*); or set list $list $package
  end

  test "$type" = "--plugin"; or for package in (basename -a $OMF_PATH/db/themes/*)
    contains $package (basename -a {$OMF_CONFIG,$OMF_PATH}/themes/*); or set list $list $package
  end

  __omf.packages.sort $list
end

function __omf.packages.list.database -a type
  set -l list

  test "$type" = "--theme"; or for package in (basename -a $OMF_PATH/db/pkg/*)
    set list $list $package
  end

  test "$type" = "--plugin"; or for package in (basename -a $OMF_PATH/db/themes/*)
    set list $list $package
  end

  __omf.packages.sort $list
end

function __omf.packages.list.installed -a type
  set -l list

  test "$type" = "--theme"; or for package in (basename -a {$OMF_CONFIG,$OMF_PATH}/pkg/*)
    contains $package (__omf.packages.builtin); or set list $list $package
  end

  test "$type" = "--plugin"; or for package in (basename -a {$OMF_CONFIG,$OMF_PATH}/themes/* 2>/dev/null)
    set list $list $package
  end

  __omf.packages.sort $list
end

function omf.packages.list -a option type
  switch "$option"
  case "--available"
    __omf.packages.list.available $type
  case "--database"
    __omf.packages.list.database $type
  case "--installed"
    __omf.packages.list.installed $type
  case "*"
    __omf.packages.list $type
  end
end

{'fraction_non_alphanumeric': 0.14258048898571773, 'fraction_numerical': 0.0002420721374969741, 'mean_word_length': 3.3267015706806284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5197160', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1430, 'n_words': 450}