Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 42 lines (29 sloc) 1.073 kb
572050a @falconindy bash_completion: add bash completion function
authored
1 #!/bin/bash
2
3 _burp() {
4fd9037 @falconindy bash_completion: cleanup logic
authored
4 local cur prev opts categories ng
572050a @falconindy bash_completion: add bash completion function
authored
5
4fd9037 @falconindy bash_completion: cleanup logic
authored
6 _get_comp_words_by_ref cur prev
572050a @falconindy bash_completion: add bash completion function
authored
7
8 # Valid upload categories
9 categories="daemons devel editors emulators games gnome i18n kde kernels lib
10 modules multimedia network office science system x11 xfce"
11
12 # Valid longopts
4fd9037 @falconindy bash_completion: cleanup logic
authored
13 opts="-u --user -p --password -c --category -k --keep-cookies -C --cookies -v --verbose"
14
15 # nullglob avoids problems when no results are found
16 [[ -o nullglob ]] || { shopt -s nullglob; ng=1; }
572050a @falconindy bash_completion: add bash completion function
authored
17
4fd9037 @falconindy bash_completion: cleanup logic
authored
18 if [[ $cur == -* ]]; then
19 COMPREPLY=( $(compgen -W "$opts" -- $cur ) )
572050a @falconindy bash_completion: add bash completion function
authored
20 else
21 case "$prev" in
22 # complete normally
23 "-C"|"--cookies")
4fd9037 @falconindy bash_completion: cleanup logic
authored
24 COMPREPLY=( $(compgen -f -- $cur) ) ;;
572050a @falconindy bash_completion: add bash completion function
authored
25
4fd9037 @falconindy bash_completion: cleanup logic
authored
26 "-c"|"--category") COMPREPLY=($(compgen -W "$categories" -- $cur)) ;;
572050a @falconindy bash_completion: add bash completion function
authored
27
28 # don't complete anything
29 "-u"|"--user"|"-p"|"--password") ;;
30
31 # else, complete *.src.tar.gz files
4fd9037 @falconindy bash_completion: cleanup logic
authored
32 *) COMPREPLY=($(compgen -f -X '!*.src.tar.gz' -- $cur)) ;;
572050a @falconindy bash_completion: add bash completion function
authored
33 esac
34 fi
35
b078bc1 @falconindy bash_completion: use eval to reset nullglob
authored
36 # restore nullglob setting
37 [[ $ng ]] && shopt -u nullglob
572050a @falconindy bash_completion: add bash completion function
authored
38
39 }
40
f803d87 @falconindy completion: specify '-o plusdirs' flag to complete to allow for director...
authored
41 complete -o plusdirs -F _burp burp
Something went wrong with that request. Please try again.