From aa78cb58ea2e6114753b74479fe58792b0d38f8e Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Mon, 6 Feb 2023 10:34:27 -0800 Subject: add usage --- README | 21 ++++++++++++++++++++- doc/snake3.man | 5 ++++- snake.c | 3 +++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README b/README index 81a9cea..c1a7668 100644 --- a/README +++ b/README @@ -1 +1,20 @@ -Simple snake game. May be networked in the future. +Snake3 +--------------------------------------- + +This is a simple snake game written in C. It is written +without ncurses or curses, and instead relies entirely +on the termios library. + +May be networked in the future. + +Install +--------------------------------------- + +In the root directory of the repository, run `make` and +`make install`. There are no dependencies. + +License +--------------------------------------- + +This program is licensed under the MIT license. See +`LICENSE` for more information. diff --git a/doc/snake3.man b/doc/snake3.man index ce14908..462fc57 100644 --- a/doc/snake3.man +++ b/doc/snake3.man @@ -3,7 +3,7 @@ snake3 \- small command line snake program .SH SYNOPSIS -\fBsnake3\fP [ --version ] +\fBsnake3\fP [--version] [--usage] .SH DESCRIPTION You control a snake, and the objective is to grow as long as possible. @@ -15,6 +15,9 @@ keys to navigate. \fB--version\fP \-\- Displays version info, and license information. +\fB--usage\fP +\-\- Displays the usage information for the snake3 program. + .SH AUTHORS Developed and maintained by Kai Stevenson, with features added by Preston Pan. diff --git a/snake.c b/snake.c index 9a88d26..cae7bb3 100644 --- a/snake.c +++ b/snake.c @@ -32,6 +32,9 @@ int main(int argc, char **argv) { printf("This software was licensed under the MIT license;\n"); printf("for more information, see the license file.\n"); return 0; + } else if (strcmp("--usage", argv[i]) == 0) { + printf("usage: snake3 [--version] [--usage]\n"); + return 0; } } //get terminal size -- cgit v1.3.1