summaryrefslogtreecommitdiff
path: root/main.go
blob: 61bf20f37e669829ef8025647497942d31a461d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main

import (
	"flag"
	"fmt"
	"net/http"
)

var base_link string
var base_aplus_link string
var token string
var external_tools_code int
var client http.Client

func main() {
	initialize()

	code := flag.String("code", "", "Code to enter")
	course := flag.Int("course", -1, "Canvas course number")
	list_all := flag.Bool("list-all", false, "List all courses")
	list_favorites := flag.Bool("list-favorites", false, "List favorite courses")

	flag.Parse()

	if *list_all {
		list_all_courses()
	}

	if *list_favorites {
		list_favorite_courses()
	}

	if *code != "" && *course != -1 {
		fmt.Printf("%d %s", *course, *code)
		submit_code(*course, *code)
	}

	submit_code(7329, "asdkl")
}