diff --git a/main.go b/main.go index 1e1d188..f2c048a 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,7 @@ import ( "time" ) +var gdprExceptions arrayFlags var students [][]string var rendusDir string var title string @@ -140,6 +141,11 @@ func genStudents() map[string]map[string]*Submission { for _, student := range students { login := student[2] + + if gdprExceptions.Contains(login) { + continue + } + ret[login] = genStudent(login) } @@ -246,11 +252,21 @@ func (i *arrayFlags) Set(value string) error { return nil } +func (i *arrayFlags) Contains(value string) bool { + for _, v := range *i { + if v == value { + return true + } + } + return false +} + func main() { var studentsFiles arrayFlags var bind = flag.String("bind", "0.0.0.0:8081", "Bind port/socket") flag.Var(&studentsFiles, "students", "Path to a CSV file containing in the third column the name of the directory to look for (can be repeated multiple times)") + flag.Var(&gdprExceptions, "gdpr-exception", "Login that should not be listed in global rendus.json (can be repeated multiple times)") flag.StringVar(&rendusDir, "path", "./rendu/", "Path to the submissions directory (each subdirectory is a project)") flag.StringVar(&title, "title", "Rendus VIRLI", "Title of the page") flag.Parse()