
# 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='deform-mesh recon-neonatal-cortex calculate-boundary-map calculate-surface-map calculate-volume-map compose-maps evaluate-surface-map evaluate-volume-map calculate-filtering calculate-gradients change-label measure-volume padding fill-holes fill-holes-nn-based em draw-em em-hard-segmentation kmeans normalize split-labels 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-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 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 transform-image calculate-surface-attributes calculate-surface-spectrum close-scalars copy-pointset-attributes decimate-surface delete-pointset-attributes dilate-scalars erode-scalars evaluate-cardiac-motion evaluate-distance evaluate-distortion evaluate-surface-mesh evaluate-surface-overlap extract-connected-points offset-surface open-scalars project-onto-surface remesh-surface smooth-surface blend-surface convert-mris convert-pointset extract-pointset-cells extract-pointset-surface extract-surface merge-surfaces transform-points match-points'
  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
