aboutsummaryrefslogtreecommitdiff
path: root/lib/hydra/completions/bash
blob: b03f666d4787bd57673c65882314a6221e06793d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
# Hydra Suite bash completion
#

_hydra() {
  # Standard stuff
  local cur prev opts config
  COMPREPLY=()
  cur="${COMP_WORDS[COMP_CWORD]}"
  prev="${COMP_WORDS[COMP_CWORD-1]}"

  # Initial options
  config="$HOME/.hydra"
  opts="`ls $config | sed -e 's/config//'`"

  # Available instances
  instances="`echo $opts | sed -e 's/ /|/'`"

  # The current instance
  instance="${COMP_WORDS[1]}"

  # Return the available options
  COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
  [[ $COMPREPLY == */ ]] && compopt -o nospace
  return 0
}

_hydractl() {
}

_hydras() {
}

complete -F _hydra hydra
complete -F _hydras hydras
complete -F _hydractl hydractl