From f5808cddfa783b5f270dca922c84e22800f62038 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Thu, 21 May 2015 16:59:07 -0400 Subject: command-line arg support --- src/help.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/help.c') diff --git a/src/help.c b/src/help.c index d4ce8e4..58e46c9 100644 --- a/src/help.c +++ b/src/help.c @@ -1,6 +1,25 @@ #include "globals.h" -void help_handler(struct player_t *player) +void print_usage(int argc, char *argv[]) { - printf("not implemented\n"); + assert(argc > 1); + + printf("Usage: %s [OPTION] [PORTFOLIO]\n", argv[0]); + printf("Runs a simulated trading session with PORTFOLIO (creating a new one by default).\n\n"); + + printf("Options:\n"); + printf(" -h, --help\tShow this help and exit\n"); + printf(" -v, --verbose\tEnable verbose operation\n"); + printf(" --version\tOutput version information and exit\n"); +} + +void print_version(void) +{ + printf("market-sim " PROGRAM_VERSION "\n"); + printf("Copyright (C) 2015 Franklin Wei.\n\n"); + printf("License GPLv2: GNU GPL version 2 \n"); + printf("This program is distributed in the hope that it will be useful, but WITHOUT ANY\n"); + printf("WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n"); + printf("PARTICULAR PURPOSE.\n"); + printf("See the GNU General Public License version 2 for more details.\n"); } -- cgit v1.1