Blame SOURCES/maven-bash-completion

cd807c
_m2_make_goals()
cd807c
{
cd807c
  plugin=$1
cd807c
  mojos=$2
cd807c
  for mojo in $mojos
cd807c
  do
cd807c
    export goals="$goals $plugin:$mojo"
cd807c
  done
cd807c
}
cd807c
cd807c
_m2_complete()
cd807c
{
cd807c
  local cur goals
cd807c
cd807c
  COMPREPLY=()
cd807c
  cur="${COMP_WORDS[COMP_CWORD]}"
cd807c
  prev="${COMP_WORDS[COMP_CWORD-1]}"
cd807c
cd807c
  case "${prev}" in
cd807c
       -f | --file|-l|--log-file)
cd807c
              COMPREPLY=( $(compgen -f ${cur}) )
cd807c
              return 0
cd807c
       ;;
cd807c
       *);;
cd807c
  esac
cd807c
cd807c
cd807c
  goals='clean compile test install package deploy site verify'
cd807c
  if [[ ${cur} == -* ]] ; then
cd807c
     goals="$goals -am --also-make
cd807c
                   -amd --also-make-dependents
cd807c
                   -B --batch-mode
cd807c
                   -C --strict-checksums
cd807c
                   -c --lax-checksums
cd807c
                   -cpu --check-plugin-updates
cd807c
                   -D --define
cd807c
                   -e --errors
cd807c
                   -emp --encrypt-master-password
cd807c
                   -ep --encrypt-password
cd807c
                   -f --file
cd807c
                   -fae --fail-at-end
cd807c
                   -ff --fail-fast
cd807c
                   -fn --fail-never
cd807c
                   -gs --global-settings
cd807c
                   -h --help
cd807c
                   -l --log-file
cd807c
                   -N --non-recursive
cd807c
                   -npr --no-plugin-registry
cd807c
                   -npu --no-plugin-updates
cd807c
                   -nsu --no-snapshot-updates
cd807c
                   -o --offline
cd807c
                   -P --activate-profiles
cd807c
                   -pl --projects
cd807c
                   -q --quiet
cd807c
                   -rf --resume-from
cd807c
                   -s --settings
cd807c
                   -T --threads
cd807c
                   -t --toolchains
cd807c
                   -U --update-snapshots
cd807c
                   -up --update-plugins
cd807c
                   -V --show-version
cd807c
                   -v --version
cd807c
                   -X --debug
cd807c
                   -Dmaven.test.skip=true
cd807c
                   -Dmaven.compiler.source=1.5
cd807c
                   -Dmaven.compiler.source=1.6
cd807c
                   -Dmaven.compiler.source=1.7
cd807c
                   -Dmaven.compiler.target=1.5
cd807c
                   -Dmaven.compiler.target=1.6
cd807c
                   -Dmaven.compiler.target=1.7
cd807c
                   -Dproject.build.sourceEncoding=UTF-8
cd807c
                   -Dmaven.repo.local=
cd807c
                   -Dmaven.local.depmap.file=
cd807c
                   -Dmaven.local.debug=true
cd807c
                   -Dmaven.local.mode=true"
cd807c
  fi
cd807c
cd807c
  goals=$goals _m2_make_goals "eclipse" "eclipse"
cd807c
  goals=$goals _m2_make_goals "idea" "idea"
cd807c
  goals=$goals _m2_make_goals "assembly" "assembly"
cd807c
  goals=$goals _m2_make_goals "plexus" "app bundle-application bundle-runtime descriptor runtime service"
cd807c
  goals=$goals _m2_make_goals "dependency" "analyze analyze-dep-mgt analyze-only analyze-report analyze-duplicate
cd807c
                                           build-classpath copy copy-dependencies get go-offline list properties
cd807c
                                           purge-local-repository resolve resolve-plugins sources tree unpack
cd807c
                                           unpack-dependencies"
cd807c
  cur=`echo $cur | sed 's/\\\\//g'`
cd807c
  COMPREPLY=($(compgen -W "${goals}" -- ${cur} | sed 's/\\\\//g') )
cd807c
}
cd807c
cd807c
complete -F _m2_complete -o filenames mvn