diff options
| author | Preston Pan <preston@nullring.xyz> | 2023-02-06 02:04:44 -0800 |
|---|---|---|
| committer | Preston Pan <preston@nullring.xyz> | 2023-02-06 02:04:44 -0800 |
| commit | 762bf741fd6db043f06448a19b554cc4946777e6 (patch) | |
| tree | 17b2089bb7cb574db685fcc42caee5cf30553d13 /snake.c | |
| parent | fdedca4e02bfcafc1cac049c98c8fa202f8d4c24 (diff) | |
add version message; change binary name
Diffstat (limited to 'snake.c')
| -rw-r--r-- | snake.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -4,6 +4,8 @@ #include <pthread.h> #include <signal.h> //handling ctrl-c #include <sys/ioctl.h> //terminal size +#include <string.h> // argument parsing + #include "vector.h" #include "snake.h" #include "conio.h" @@ -23,6 +25,15 @@ vector_t foodPos; vector_t lastMoveDir; int main(int argc, char **argv) { + for (int i = 0; i < argc; i ++) { + if (strcmp("--version", argv[i]) == 0) { + printf("snake3, version 1.0\n"); + printf("Copyright 2023 Kai Stevenson\n"); + printf("This software was licensed under the MIT license;\n"); + printf("for more information, see the license file.\n"); + return 0; + } + } //get terminal size struct winsize win; ioctl(fileno(stdout), TIOCGWINSZ, &win); |
