
# Auto-generated by MIRTK root CMakeLists.txt during CMake configure.
#
# To enable Bash completion of "mirtk" subcommands, add the following to your
# ~/.bashrc (Linux) or ~/.bash_profile (OS X) file:
#
#   [ ! -f "$MIRTK_ROOT/share/completion/bash/mirtk" ] ||
#   source "$MIRTK_ROOT/share/completion/bash/mirtk"
#   [ ! -f "$MIRTK_ROOT/share/mirtk/completion/bash/mirtk" ] ||
#   source "$MIRTK_ROOT/share/mirtk/completion/bash/mirtk"
#
# Alternatively, copy this file to:
# - /etc/bash_completion.d/ (Linux)
# - $(brew --prefix)/etc/bash_completion.d/ (OS X, Homebrew)
#
_mirtk_complete()
{
  local commands='help-rst info aggregate-images average-images calculate-element-wise calculate-distance-map calculate-exponential-map calculate-lie-bracket calculate-logarithmic-map close-image combine-images convert-image cut-brain detect-edges dilate-image downsample-image edit-image erode-image evaluate-label-overlap evaluate-overlap extract-connected-components extract-image-region extract-image-slice extract-image-volume flip-image match-histogram open-image reflect-image resample-image smooth-image subdivide-brain-image detect-cardiac-phases auto-contrast evaluate-similarity average-measure average-overlap register construct-atlas evaluate-atlas edit-dof invert-dof average-dofs bisect-dof compose-dofs convert-dof evaluate-dof evaluate-jacobian init-dof random-dof transform-image'
  local noreply='true'
  if [ $COMP_CWORD -eq 2 ]; then
    if [ ${COMP_WORDS[1]} = help ] || [ ${COMP_WORDS[1]} = help-rst ]; then
      COMPREPLY=( `compgen -W "$commands" -- ${COMP_WORDS[COMP_CWORD]}` )
      noreply='false'
    fi
  elif [ $COMP_CWORD -eq 1 ]; then
    COMPREPLY=( `compgen -W "help help-rst $commands" -- ${COMP_WORDS[COMP_CWORD]}` )
    noreply='false'
  fi
  if [ $noreply = true ]; then
    local IFS=$'
'
    COMPREPLY=(`compgen -o plusdirs -f -- "${COMP_WORDS[COMP_CWORD]}"`)
    compopt -o filenames +o nospace 2>/dev/null || compgen -f /non-existing-dir/ > /dev/null
  fi
}
complete -F _mirtk_complete mirtk
