forked from rgcr/m-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfinder
executable file
·48 lines (41 loc) · 1013 Bytes
/
finder
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
45
46
47
48
#!/bin/sh
# TODO: add more functionalities
help(){
cat<<__EOF__
usage: m finder [ showhiddenfiles | help ]
Examples:
m finder showhiddenfiles # get the current status
m finder showhiddenfiles YES # show hidden files
m finder showhiddenfiles NO # no show hidden files
__EOF__
}
hidden_files(){
case $1 in
[yY][eE][sS])
echo "Show Hidden files: YES"
defaults write com.apple.finder AppleShowAllFiles YES
;;
[nN][oO])
echo "Show Hidden files: NO"
defaults write com.apple.finder AppleShowAllFiles NO
;;
*)
echo "Show Hidden files: $(defaults read com.apple.finder AppleShowAllFiles)"
exit 1
;;
esac
killall Finder
}
case $1 in
help)
help
;;
showhiddenfiles)
shift
hidden_files $@
;;
*)
help
;;
esac
# vim: set ts=4 sw=4 softtabstop=4 expandtab