-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbm
73 lines (63 loc) · 1.34 KB
/
bm
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
readonly script_name="bm"
readonly version="0.1.0"
readonly emoji=📁
function usage() {
# TODO Handle the other options
cat <<USAGE_TEXT
A command-line utility for bookmarks.
Usage: ${script_name} [option] [<argument>]
OPTIONS:
-h, --help Print this usage information
-v, --version Print the ${script_name} version
These are common bm commands used in various situations:
add Adds new link
category Creates and lists the categories
delete Deletes the bookmark
list Lists the all bookmarks
remove Removes the category
For bug reporting and contributions, please see:
<https://github.com/gozeloglu/bm>
USAGE_TEXT
}
if (( $# == 0 )); then
usage
exit 1
fi
case "$1" in
add)
"${PWD}/commands/add.sh" "$@"
shift
;;
delete)
"${PWD}/commands/delete.sh" "$@"
shift
;;
remove)
"${PWD}/commands/remove.sh" "$@"
shift
;;
list)
"${PWD}/commands/list.sh" "$@"
shift
;;
setup)
"${PWD}/commands/setup.sh"
shift
;;
--help | -h)
usage
shift
;;
--version | -v)
echo "bm $(cat ${PWD}/VERSION)"
shift
;;
*)
echo "Invalid Command"
echo "See '${script_name} --help'."
;;
esac