diff options
| author | Franklin Wei <git@fwei.tk> | 2015-05-21 16:59:07 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2015-05-21 16:59:07 -0400 |
| commit | f5808cddfa783b5f270dca922c84e22800f62038 (patch) | |
| tree | 0c041e891e358a1ce1e1f7b715a09cd802419725 /src/help.c | |
| parent | 28ff4aa610c6c98645973ed4fc9acb6cc7a0cf30 (diff) | |
| download | market-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.c | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -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"); } |