# See → fishshell.com/docs/current/commands.html#complete

function __fish_mix_needs_command
  set cmd (commandline -opc)
  if [ (count $cmd) -eq 1 -a $cmd[1] = 'mix' ]
    return 0
  end
  return 1
end

# fish completion for mix
function __fish_mix_tasks
    mix help ^/dev/null | awk '{
        if ($1 == "mix") {
            if ($3 == "#") {
                print $2"\t"substr($0, index($0, $4))
            } else {
                print $1"\t"substr($0, index($0, $3))
            }
        }
    }'
end

complete -c mix -n '__fish_mix_needs_command' -f -a '(__fish_mix_tasks)'

# See → fishshell.com/docs/current/commands.html#complete

function __fish_mix_needs_command
  set cmd (commandline -opc)
  if [ (count $cmd) -eq 1 -a $cmd[1] = 'mix' ]
    return 0
  end
  return 1
end

# fish completion for mix
function __fish_mix_tasks
    mix help 2>/dev/null | awk '{
        if ($1 == "mix") {
            if ($3 == "#") {
                print $2"\t"substr($0, index($0, $4))
            } else {
                print $1"\t"substr($0, index($0, $3))
            }
        }
    }'
end

complete -c mix -n '__fish_mix_needs_command' -f -a '(__fish_mix_tasks)'

Replace disabled stderr redirection char ^ with 2>
Replace disabled stderr redirection char ^ with 2>

Since [Fish 3.3.0][1], redirection to standard error with the `^`
character has been disabled by default.

Ref [oh-my-fish/oh-my-fish#585][2]

[1]: https://github.com/fish-shell/fish-shell/blob/master/CHANGELOG.rst#deprecations-and-removed-features-1
[2]: https://github.com/oh-my-fish/oh-my-fish/issues/585

belltoy/plugin-mix