changeset 545:7cd9e895fa09

Supply usage when no argument supplied
author HIROSE Yuuji <yuuji@gentei.org>
date Sat, 06 Apr 2019 20:05:35 +0900
parents 6039630ea2f5
children 768e80ef2b80
files scripts/add-user-csv.sh
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/add-user-csv.sh	Sat Apr 06 19:56:15 2019 +0900
+++ b/scripts/add-user-csv.sh	Sat Apr 06 20:05:35 2019 +0900
@@ -1,6 +1,14 @@
 #!/bin/sh
-# Usage: ./add-user-csv.sh CSVfile
 
+if [ -z "$1" ]; then
+  cat<<-EOF >&2
+	Usage: ./add-user-csv.sh CSVfile >&2
+	Csv file should be the form of:
+	   username(email),notify-email,gecos,IniPassword
+	EOF
+  exit 1
+fi
+   
 target=$(cd `dirname "$1"`; pwd)/`basename $1`
 
 cd `dirname $0`/..

yatex.org