-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbash_hfm
More file actions
38 lines (31 loc) · 683 Bytes
/
bash_hfm
File metadata and controls
38 lines (31 loc) · 683 Bytes
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
# Host File Manager
#
# This is used to help you manage and switch multiple host files
# around in a simple quick manner
#
# @author James Solomon <solomonjames@gmail.com>
############ Start Bash Host File Manager
function h {
cat ~/.hfm/main > ~/.hfm/hostsfile
for var in "$@"
do
if [ $var != "default" ]
then
cat ~/.hfm/files/$var >> ~/.hfm/hostsfile
fi
done
}
function hl {
ls ~/.hfm/files
}
# completion command for h
function _hcomp {
local curw
COMPREPLY=()
curw=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=($(compgen -W '`hl`' -- $curw))
return 0
}
# bind completion command for h to _hcomp
complete -F _hcomp h
############ End Bash Host File Manager