diff options
| -rw-r--r-- | main.go | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -19,13 +19,13 @@ func main() { | |||
| 19 | 19 | ||
| 20 | code := getopt.StringLong("code", 'c', "", "Code to enter") | 20 | code := getopt.StringLong("code", 'c', "", "Code to enter") |
| 21 | course := getopt.IntLong("course", 'C', -1, "Canvas course number") | 21 | course := getopt.IntLong("course", 'C', -1, "Canvas course number") |
| 22 | list_all := getopt.BoolLong("list-all", 0, "List all courses") | 22 | list_all := getopt.BoolLong("list-all", 'L', "List all courses") |
| 23 | list_favorites := getopt.BoolLong("list-favorites", 0, "List favorite courses") | 23 | list_favorites := getopt.BoolLong("list-favorites", 'F', "List favorite courses") |
| 24 | help := getopt.BoolLong("help", 0, "Help") | 24 | help := getopt.BoolLong("help", 'h', "Help") |
| 25 | 25 | ||
| 26 | getopt.Parse() | 26 | getopt.Parse() |
| 27 | 27 | ||
| 28 | if *help { | 28 | if *help || (*list_all == false && *list_favorites == false && *code == "" && *course == -1) { |
| 29 | getopt.Usage() | 29 | getopt.Usage() |
| 30 | os.Exit(0) | 30 | os.Exit(0) |
| 31 | } | 31 | } |
