Blame SOURCES/maven-bash-completion

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