diff options
| author | vin <git@vineetk.net> | 2024-01-11 18:36:22 -0500 |
|---|---|---|
| committer | vin <git@vineetk.net> | 2024-01-11 22:55:43 -0500 |
| commit | de8ed98b4c43c2486d72eb6b5a9301f42d2a61d6 (patch) | |
| tree | 5fb2ac810420ab6c994829bb1487769fa796dac0 /main.go | |
| parent | e9c76998dc146ebc5f22100c972b52c70a51899d (diff) | |
start working on submitting course without user-provided course code
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 9 |
1 files changed, 4 insertions, 5 deletions
| @@ -54,7 +54,7 @@ func main() { | |||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | if listall { | 56 | if listall { |
| 57 | list_all_courses() | 57 | _ = list_all_courses(false) |
| 58 | os.Exit(0) | 58 | os.Exit(0) |
| 59 | } | 59 | } |
| 60 | 60 | ||
| @@ -71,10 +71,6 @@ func main() { | |||
| 71 | if len(code) == 5 && course != -1 { | 71 | if len(code) == 5 && course != -1 { |
| 72 | fmt.Printf("%d %s\n", course, code) | 72 | fmt.Printf("%d %s\n", course, code) |
| 73 | submit_code(course, code) | 73 | submit_code(course, code) |
| 74 | } else if code != "" && course == -1 { | ||
| 75 | fmt.Println("Course code not provided") | ||
| 76 | usage() | ||
| 77 | os.Exit(1) | ||
| 78 | } else if code == "" && course != -1 { | 74 | } else if code == "" && course != -1 { |
| 79 | fmt.Println("Attendance code not provided") | 75 | fmt.Println("Attendance code not provided") |
| 80 | usage() | 76 | usage() |
| @@ -83,5 +79,8 @@ func main() { | |||
| 83 | fmt.Println("Attendance code must be 5 characters long") | 79 | fmt.Println("Attendance code must be 5 characters long") |
| 84 | usage() | 80 | usage() |
| 85 | os.Exit(1) | 81 | os.Exit(1) |
| 82 | } else if len(code) == 5 && course == -1 { | ||
| 83 | fmt.Println("Checking which course to send the code to") | ||
| 84 | submit_code_sans_course(code) | ||
| 86 | } | 85 | } |
| 87 | } | 86 | } |
