Skip to content

Commit fdeab27

Browse files
committed
Add command usage
1 parent c986988 commit fdeab27

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

lazy-connect.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ EOF
3434
cat $config_dir/vpns | nl
3535
}
3636

37+
function _lazy_connect_usage() {
38+
cat <<EOF
39+
40+
USAGE:
41+
42+
lazy-connect
43+
44+
-i - Initialize lazy-connect.
45+
Stores the secret and VPN list to ~/.config/lazy-connect/
46+
-h - Show this help
47+
EOF
48+
}
49+
3750
function _lazy_connect() {
3851
vpn_name=$1
3952
secret_key=$2
@@ -67,7 +80,7 @@ function lazy-connect() {
6780
while getopts "ih" opt; do
6881
case $opt in
6982
h)
70-
echo "Usage"
83+
_lazy_connect_usage
7184
return 0
7285
;;
7386
i)
@@ -76,12 +89,12 @@ function lazy-connect() {
7689
;;
7790
\?)
7891
echo "Invalid Option: -$OPTARG."
79-
echo "Usage"
92+
_lazy_connect_usage
8093
return 1
8194
;;
8295
:)
8396
echo "Option -$OPTARG requires an argument."
84-
echo "Usage"
97+
_lazy_connect_usage
8598
return 1
8699
;;
87100
esac

0 commit comments

Comments
 (0)