-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsq
executable file
·57 lines (51 loc) · 1.17 KB
/
tsq
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
49
50
51
52
53
54
55
56
57
#!/bin/bash
set -e
usage () {
echo -e "Usage: `basename $0` <cmd> [<args>]"
echo -e "\nCommands:"
echo -e "\tb, belongs - list what package file belongs to"
echo -e "\td, depends - show depending packages"
echo -e "\ti, info - show package information"
echo -e "\tg, depgraph - show package's install dependencies"
echo -e "\tf, files - list all files installed by package"
echo -e "\tl, pkglist - list all packages"
echo -e "\tr, grep - grep filename in packages"
echo -e "\tt, tree - show package dependency tree"
}
if [ "$#" -lt 1 ] ; then
usage
exit 1
fi
readonly cmd="$1"
shift
readonly scripts_dir="$( cd "$( dirname `readlink -f ${BASH_SOURCE[0]}` )" && pwd )"/scripts
case ${cmd} in
b|belongs)
${SHELL} ${scripts_dir}/belongs.sh $@
;;
d|depends)
${SHELL} ${scripts_dir}/depends.sh $@
;;
f|files)
${SHELL} ${scripts_dir}/files.sh $@
;;
g|depgraph)
${SHELL} ${scripts_dir}/depgraph.sh $@
;;
i|info)
${SHELL} ${scripts_dir}/info.sh $@
;;
l|pkglist)
${SHELL} ${scripts_dir}/pkglist.sh $@
;;
r|grep)
${SHELL} ${scripts_dir}/grep.sh $@
;;
t|tree)
${SHELL} ${scripts_dir}/tree.sh $@
;;
*)
usage
exit 1
;;
esac