aboutsummaryrefslogtreecommitdiff
path: root/src/help.c
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2015-05-21 16:59:07 -0400
committerFranklin Wei <git@fwei.tk>2015-05-21 16:59:07 -0400
commitf5808cddfa783b5f270dca922c84e22800f62038 (patch)
tree0c041e891e358a1ce1e1f7b715a09cd802419725 /src/help.c
parent28ff4aa610c6c98645973ed4fc9acb6cc7a0cf30 (diff)
downloadmarket-sim-f5808cddfa783b5f270dca922c84e22800f62038.zip
market-sim-f5808cddfa783b5f270dca922c84e22800f62038.tar.gz
market-sim-f5808cddfa783b5f270dca922c84e22800f62038.tar.bz2
market-sim-f5808cddfa783b5f270dca922c84e22800f62038.tar.xz
command-line arg support
Diffstat (limited to 'src/help.c')
-rw-r--r--src/help.c23
1 files changed, 21 insertions, 2 deletions
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 <http://www.gnu.org/licenses/gpl-2.0.html>\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");
}