commit 6599f9fb8714fa60be20fe970f41567020107b5c
parent 024ad693fd76d375d8e7ba451bb12f68c4dfae2f
Author: Claudio Alessi <smoppy@gmail.com>
Date: Fri, 12 Jul 2024 00:05:02 +0200
Remove full path from $0 in die() and usage()
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/iwpick b/src/iwpick
@@ -9,6 +9,8 @@ newline="
SCANRETRIES=3
SCANWAITSEC=3
+ARGV0="$(basename "$0")"
+
connect() {
iface=$1
essid=$2
@@ -40,7 +42,7 @@ connect() {
}
die() {
- echo "$0: $@"
+ echo "$ARGV0: $@"
exit 1
}
@@ -84,7 +86,7 @@ pickone() {
}
usage() {
-echo -n "Usage: $0 [-hg] [-i <iface>] [-e <essid>] [-k <psk>] [-a <alias>]
+echo -n "Usage: $ARGV0 [-hg] [-i <iface>] [-e <essid>] [-k <psk>] [-a <alias>]
-i <iface> Network interface
-a <alias> Use the specified alias to connect
-e <essid> ESSID of the network to connect