-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathprogscrape.sh
executable file
·44 lines (40 loc) · 1.29 KB
/
progscrape.sh
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
37
38
39
40
41
42
43
44
# bash auto-completion for progscrape
# Put this file (or a link to it) in /etc/bash_completion.d/
__progscrape()
{
local cur prev
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in
--base-url)
COMPREPLY=( $( compgen -W 'http://dis.4chan.org' -- $cur ) )
return 0
;;
--board)
COMPREPLY=( $( compgen -W \
'/lounge/ /vip/ /newnew/ /newpol/ /lang/ /sci/ /tech/ /food/ \
/sports/ /comp/ /prog/ /img/ /sjis/ /tele/ /book/ /music/ \
/anime/ /carcom/ /games/' -- $cur ) )
return 0
;;
--threads)
COMPREPLY='auto'
return 0
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--json --no-json \
--html --no-html \
--progress-bar --no-progress-bar \
--verify-trips --no-verify-trips \
--base-url --port --board --charset \
--aborn --no-aborn --partial --threads \
--dry-run --no-dry-run \
--help -h' -- $cur ) )
elif [ ! -z $(type -t _filedir) ]; then
_filedir db
fi
}
complete -F __progscrape $filenames progscrape
complete -F __progscrape $filenames progscrape.py