From c1faa4a7db2ea1f13673d9934ed22cdd4330ab15 Mon Sep 17 00:00:00 2001 From: mcmartin Date: Thu, 19 Feb 2004 08:19:55 +0000 Subject: [PATCH] Fixed a bug in the logfile option Also added the --logfile long form and documented it more thoroughly. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1325 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/doc/users/manual.txt | 5 +++++ sc2/src/starcon2.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sc2/doc/users/manual.txt b/sc2/doc/users/manual.txt index 2e2e8eea3..6cb0835c9 100644 --- a/sc2/doc/users/manual.txt +++ b/sc2/doc/users/manual.txt @@ -65,6 +65,11 @@ Print fps information in the status window. Set the directory where the game will seek its data. + -l (or --logfile) + +Set a file to receive the diagnostic information that would otherwise go +to the console. + -h (or --help) Display a help message. diff --git a/sc2/src/starcon2.c b/sc2/src/starcon2.c index b0d6763e6..789c83d10 100644 --- a/sc2/src/starcon2.c +++ b/sc2/src/starcon2.c @@ -112,6 +112,7 @@ main (int argc, char *argv[]) {"nosubtitles", 0, NULL, 'u'}, {"music", 1, NULL, 'm'}, {"gamma", 1, NULL, 'g'}, + {"logfile", 1, NULL, 'l'}, // options with no short equivalent {"cscan", 1, NULL, CSCAN_OPT}, {"menu", 1, NULL, MENU_OPT}, @@ -128,7 +129,7 @@ main (int argc, char *argv[]) option. If it was given, redirect stderr to the named file */ opterr = 0; - while ((c = getopt_long (argc, argv, "l:", NULL, 0)) != -1) + while ((c = getopt_long (argc, argv, "l:", long_options, 0)) != -1) { switch (c) { case 'l': @@ -349,7 +350,7 @@ main (int argc, char *argv[]) printf(" -q, --audioquality=QUALITY (high, medium or low, " "default medium)\n"); printf(" -u, --nosubtitles\n"); - printf(" -l FILE (sends console output to logfile FILE)\n"); + printf(" -l, --logfile=FILE (sends console output to logfile FILE)\n"); printf(" --addon (using a specific addon; " "may be specified multiple times)\n"); printf(" --sound=DRIVER (openal, mixsdl, none; default "