<commit_before><commit_msg>Add cask-commit command<commit_after>function cask-commit
  set cask $argv

  # Get the version of the app
  set info (brew cask info $cask)
  echo $info[2] | cut -f1 -d ',' | read -a name
  echo $info[1] | tr -s "\n" | read -a vars
  set ver $vars[2]

  # Test cask
  brew cask cleanup
  brew cask fetch $cask

  echo "$cask: $name ($ver)"
  echo "continue(y/Y)? "
  read input

  switch $input
  case y Y
    git checkout master
    git checkout -b "$cask-$ver"
    git add "Casks/$cask.rb"
    git commit -m "Update $name to $ver"
    # TODO parse the remote repository's name
    git push buo
    git checkout master
  end
end

function __fish_cask_commit_casks
  command git status | grep "modified:   Casks/" | tr -d '\t ' | cut -d ':' -f2 | sed 's/Casks\///' | sed 's/.rb//'
end

complete -c cask-commit -f -a '(__fish_cask_commit_casks)'
{'fraction_non_alphanumeric': 0.12729357798165136, 'fraction_numerical': 0.005733944954128441, 'mean_word_length': 2.7629310344827585, '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': '7040400', 'n_tokens_mistral': 336, 'n_tokens_neox': 321, 'n_words': 116}