python/mach/bash-completion.sh
author Marian-Vasile Laza <mlaza@mozilla.com>
Sun, 28 Nov 2021 21:52:09 +0200
changeset 600343 34a7b5b9dbecc9b71e722625001889ded6d43dda
parent 453501 729ea50e304585cd0b42ed9138a47b9e7ae68bb0
permissions -rw-r--r--
Backed out changeset 696485034af5 (bug 1742916) for causing reftest test failures on woff2-totalsfntsize.html. CLOSED TREE

function _mach()
{
  local cur targets
  COMPREPLY=()

  # Calling `mach-completion` with -h/--help would result in the
  # help text being used as the completion targets.
  if [[ $COMP_LINE == *"-h"* || $COMP_LINE == *"--help"* ]]; then
    return 0
  fi

  # Load the list of targets
  targets=`"${COMP_WORDS[0]}" mach-completion ${COMP_LINE}`
  cur="${COMP_WORDS[COMP_CWORD]}"
  COMPREPLY=( $(compgen -W "$targets" -- ${cur}) )
  return 0
}
complete -o default -F _mach mach