-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathalrc
executable file
·62 lines (54 loc) · 1.38 KB
/
alrc
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
#!/usr/bin/env bash
# By fmways
ALRC_HOME="$(cd -- "$(dirname -- "$(realpath "${BASH_SOURCE[0]}")")" &> /dev/null && pwd)"
VERSION="$(echo "$ALRC_VERSION")"
#$(cat "${ALRC_HOME}/alrc-termux.sh" | sed -n 's/^# version : //p')"
CMD="$(basename -- $0)"
_usage() {
echo -e "Usage :"
echo -e "\t$CMD [options]"
echo
echo -e "Options :"
echo -e " h\thelp\t\t display this message"
echo -e " v\tversion\t\t display alrc-termux version"
echo -e " i\tinstall\t\t install alrc-termux to your termux"
echo -e " up\tupdate\t\t update alrc-termux"
echo -e " un\tuninstall\t uninstall alrc-termux from your termux"
echo -e " in\tinit\t\t init directly from file ~/.shortcuts/alrc.test to load .bash_profile templates."
echo -e " env\t\t\t display environment for alrc-termux"
echo
echo -e "Example :"
echo -e "\t$CMD update"
echo -e "\t$CMD uninstall"
echo -e "\tsource <($CMD env)"
}
_main() {
case "$1" in
h|help)
_usage
;;
v|-v|version|--version)
echo $VERSION
;;
i|install)
$ALRC_HOME/install.sh
;;
up|update)
$ALRC_HOME/update.sh
;;
un|uninstall)
$ALRC_HOME/uninstall.sh
;;
env)
source $ALRC_HOME/env.sh 2> /dev/null;
;;
in|init|test)
bash $HOME/.shortcuts/alrc.test
;;
*)
echo "Unknown arguments" > /dev/stderr
_usage
return 1;;
esac
}
_main $@