From 421f7d82d8a5f364f9e5e20e7435b83664e4746b Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Fri, 17 Jan 2014 11:06:14 -0500 Subject: added usage section for csv2GradeBook.tcl --- csv2GradeBook.tcl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'csv2GradeBook.tcl') diff --git a/csv2GradeBook.tcl b/csv2GradeBook.tcl index c880fad..7c52ee6 100755 --- a/csv2GradeBook.tcl +++ b/csv2GradeBook.tcl @@ -7,6 +7,18 @@ package require sqlite3 package require md5 source ./GradeBook_lib.tcl +if { $argc < 2 } { + puts {Usage:} + puts " $argv0 database_name file_with_csv" + puts {} + puts { expect the csv file with following fields:} + puts { sid, FName, LName, Section, email} + puts {} + puts {Example:} + puts [concat " $argv0" { 2013_Spring_Phys742 roster.csv}] + exit +} + set class [lindex $argv 0] if { $class eq "" } { set class dummy_class @@ -43,8 +55,6 @@ proc AddUserNonWeb { first_name last_name user_name {group_name {guest}} {id_num #AddUserNonWeb first_name last_name user_name password_hash group_name id_number section_num i # dummy users -# expect the csv file with following fields -# sid, FName, LName, Section, email set fp [open $csvfile r] while {-1 != [gets $fp line]} { -- cgit v1.2.3