Author: soliton
Date: Fri Sep 26 12:09:48 2008
New Revision: 29685

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29685&view=rev
Log:
* when specifying --config-dir now put it under %APPDATA% on windows
  (default remains as cwd\userdata but can be changed when defining
  APPDATA_USERDATA at compile-time.)
* sync commandline option descriptions between the manpage and --help

Modified:
    trunk/RELEASE_NOTES
    trunk/changelog
    trunk/doc/man/wesnoth.6
    trunk/src/filesystem.cpp
    trunk/src/game.cpp

Modified: trunk/RELEASE_NOTES
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/RELEASE_NOTES?rev=29685&r1=29684&r2=29685&view=diff
==============================================================================
--- trunk/RELEASE_NOTES (original)
+++ trunk/RELEASE_NOTES Fri Sep 26 12:09:48 2008
@@ -12,9 +12,5 @@
 
 *** 1.5.4+svn
 
-Under windows the location of the user data directory changed to AppData in
-user's home directory. If giving "--config-dir SHARED" as command line 
parameter
-wesnoth uses the old userdata directory inside installation directory.
-
 ***
 

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=29685&r1=29684&r2=29685&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Fri Sep 26 12:09:48 2008
@@ -47,6 +47,10 @@
    * Improved village grabbing and protection.
    * Made 'caution' to control how dangerous place AI tries to attack
  * Miscellaneous and bug fixes:
+   * The config dir can now be changed when defining APPDATA_USERDATA at
+     compile-time to default to a dir under %APPDATA% on windows.
+     When specifying --config-dir on the command line %APPDATA% is used even
+     without that define.
    * Fixed the list of the unit's attacks getting cut off in the right panel
      (bug #12297).
    * Fixed wesnoth not to try to add duplicate ids to unit_map

Modified: trunk/doc/man/wesnoth.6
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/doc/man/wesnoth.6?rev=29685&r1=29684&r2=29685&view=diff
==============================================================================
--- trunk/doc/man/wesnoth.6 (original)
+++ trunk/doc/man/wesnoth.6 Fri Sep 26 12:09:48 2008
@@ -48,30 +48,33 @@
 .B --bpp 32
 .TP
 .B -c, --campaign
-skip menu, show directly the campaign menu.
-.TP
-.B --config-dir <name>
-Makes wesnoth use <name> directory in $HOME for storing user data.
-win32: If <name> is SHARED wesnoth uses userdata directory in weanoth 
instalation directory.
+goes directly to the campaign selection menu.
+.TP
+.BI --config-dir \ name
+sets the user configuration directory to
+.I name
+under $HOME or %APPDATA% for windows.
+.TP
+.B --config-path
+prints the path of the user configuration directory and exits.
 .TP
 .B -d, --debug
-shows extra debugging information and enables additional command mode
-options in-game (see the website at http://www.wesnoth.org/wiki/CommandMode
-for more information about command mode).
+enables additional command mode options in-game
+(see the wiki page at http://www.wesnoth.org/wiki/CommandMode for more 
information about command mode).
 .TP
 .B --dummylocales
-Use special dummy locales to switch to any language even if that language 
-isn't installed to system
+use special dummy locales to switch to any language even if that language
+isn't installed system-wide.
 .TP
 .B -e, --editor
-Start the in-game map editor directly
-.TP
-.B -f, --fullscreen
-runs the game in full screen mode.
+start the in-game map editor directly.
 .TP
 .B --fps
 displays the number of frames per second the game is currently running
 at, in a corner of the screen.
+.TP
+.B -f, --fullscreen
+runs the game in full screen mode.
 .TP
 .BI --gunzip \ infile.gz
 decompresses a file which should be in gzip format and stores it 
@@ -89,7 +92,7 @@
 displays a summary of command line options to standard output, and exits.
 .TP
 .BI -l,\ --load \ file
-loads the savegame 
+loads the savegame
 .I file
 from the standard save game directory.
 If the 
@@ -100,9 +103,6 @@
 .I file
 open.
 .TP
-.B --with-replay
-replays the game loaded with --load option.
-.TP
 .BI --log- level = domain1 , domain2 , ...
 sets the severity level of the log domains.
 .B all
@@ -126,49 +126,52 @@
 .B --multiplayer
 as explained below.
 .TP
+.B --no-delay
+runs the game without any delays for graphic benchmarking.  This is 
automatically enabled by
+.BR --nogui .
+.TP
 .B --nocache
 disables caching of game data.
 .TP
+.B --nomusic
+runs the game without music.
+.TP
 .B --nosound
 runs the game without sounds and music.
 .TP
-.B --nomusic
-runs the game without only music.
-.TP
 .B --path
 prints the name of the game data directory and exits.
 .TP
-.B --config-path
-prints the name of the user configuration directory and exits.
+.B --python-api
+prints the runtime documentation for the python API.
 .TP
 .BI -r\  X x Y ,\ --resolution\  X x Y
 sets the screen resolution. Example:
 .B -r 800x600
 .TP
+.B --smallgui
+allows to use screen resolutions down to 800x480 and resizes a few interface 
elements.
+.TP
 .BI -s,\ --server\ [host]
-skip menu, connect to specified host if any, otherwise connect to the first 
server in preferences. Example:
+connects to the specified host if any, otherwise connect to the first server 
in preferences. Example:
 .B --server server.wesnoth.org
 .TP
 .B -t, --test
 runs the game in a small test scenario.
 .TP
+.B --validcache
+assumes that the cache is valid. (dangerous)
+.TP
 .B -v, --version
 shows the version number and exits.
 .TP
 .B -w, --windowed
 runs the game in windowed mode.
 .TP
-.B --no-delay
-runs the game without any delays for graphic benchmarking.  This is 
automatically enabled by
-.BR --nogui .
-.TP
-.B --nogui
-runs the game without the GUI. Must appear before
-.B --multiplayer
-to have the desired effect.
-.TP
-.B --exit-at-end
-exits once the scenario is over, without displaying victory/defeat dialog 
which requires the user to click OK.  This is also used for scriptable 
benchmarking.
+.B --with-replay
+replays the game loaded with the
+.B --load
+option.
 .
 .SH Options for --multiplayer
 .
@@ -198,6 +201,15 @@
 .B "data/multiplayer/eras.cfg"
 file.
 .TP
+.B --exit-at-end
+exits once the scenario is over, without displaying victory/defeat dialog 
which requires the user to click OK.
+This is also used for scriptable benchmarking.
+.TP
+.B --nogui
+runs the game without the GUI. Must appear before
+.B --multiplayer
+to have the desired effect.
+.TP
 .BI --parm number = name : value
 sets additional parameters for this side. This parameter depends on the
 options used with

Modified: trunk/src/filesystem.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/filesystem.cpp?rev=29685&r1=29684&r2=29685&view=diff
==============================================================================
--- trunk/src/filesystem.cpp (original)
+++ trunk/src/filesystem.cpp Fri Sep 26 12:09:48 2008
@@ -448,9 +448,11 @@
 const std::string PREFERENCES_DIR = ".wesnoth" + 
std::string(game_config::version).substr(0,3);
 #endif
 #ifdef _WIN32
+#ifdef APPDATA_USERDATA
+       const char* const appdata = getenv("APPDATA");
+#else
        const char* appdata = "";
-       if(path != "SHARED")
-               appdata = getenv("APPDATA");
+#endif
        if (strlen(appdata) > 0)
        {
                if (path.empty())
@@ -464,6 +466,15 @@
                {
                        path = "userdata";
                }
+#ifndef APPDATA_USERDATA
+               else
+               {
+                       // if the path is given fallback to %APPDATA%.
+                       appdata = getenv("APPDATA");
+                       game_config::preferences_dir = appdata + 
std::string("/") + path;
+                       return;
+               }
+#endif
                char buf[512];
                const char* const res = getcwd(buf,sizeof(buf));
                if (res == NULL)
@@ -479,8 +490,9 @@
        }
 
 #else
-       if (path.empty())
+       if (path.empty()) {
                path = PREFERENCES_DIR;
+       }
 #ifndef __AMIGAOS4__
        const char* const current_dir = ".";
        const char* home_str = getenv("HOME");

Modified: trunk/src/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=29685&r1=29684&r2=29685&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Fri Sep 26 12:09:48 2008
@@ -1681,77 +1681,88 @@
 
                if(val == "--help" || val == "-h") {
                        // When adding items don't forget to update 
doc/man/wesnoth.6
+                       // Options are sorted alphabetically by --long-option.
+                       // Please keep the output to 80 chars per line.
                        std::cout << "usage: " << argv[0]
-                       << " [OPTIONS] [DATA-DIRECTORY]\n"
-                       << "  --bpp number                 sets BitsPerPixel 
value. Example: --bpp 32\n"
-                       << "  -d, --debug                  shows extra 
debugging information and enables\n"
-                       << "                               additional command 
mode options in-game.\n"
+                       << " [<options>] [<data-directory>]\n"
+                       << "Available options:\n"
+                       << "  --bpp <number>               sets BitsPerPixel 
value. Example: --bpp 32\n"
+                       << "  -c, --campaign               goes directly to the 
campaign selection menu.\n"
+                       << "  --config-dir <name>          sets the path of the 
user config directory to\n"
+                       << "                               $HOME/<name> or 
%APPDATA%\\<name> for windows.\n"
+                       << "  --config-path                prints the path of 
the user config directory and\n"
+                       << "                               exits.\n"
+                       << "  -d, --debug                  enables additional 
command mode options in-game.\n"
+                       << "  --dummylocales               enables dummy 
locales for switching to non-system\n"
+                       << "                               locales.\n"
 #ifndef DISABLE_EDITOR2
-                       << "  -e, --editor                 starts editor2 not 
showing title screen.\n"
+                       << "  -e, --editor                 starts the in-game 
map editor directly.\n"
 #endif
+                       << "  --fps                        displays the number 
of frames per second the\n"
+                       << "                               game is currently 
running at, in a corner of\n"
+                       << "                               the screen.\n"
                        << "  -f, --fullscreen             runs the game in 
full screen mode.\n"
-                       << "  --fps                        displays the number 
of frames per second the game\n"
-                       << "                               is currently running 
at, in a corner of the screen.\n"
-                       << "  --gunzip INFILE.gz           decompresses a file 
(INFILE.gz) in gzip format\n"
+                       << "  --gunzip <infile>.gz         decompresses a file 
(<infile>.gz) in gzip format\n"
                        << "                               and stores it 
without the .gz suffix.\n"
-                       << "                               INFILE.gz will be 
removed.\n"
-                       << "  --gzip INFILE                compresses a file 
(INFILE) in gzip format,\n"
-                       << "                               stores it as 
INFILE.gz and removes INFILE.\n"
+                       << "                               <infile>.gz will be 
removed.\n"
+                       << "  --gzip <infile>              compresses a file 
(<infile>) in gzip format,\n"
+                       << "                               stores it as 
<infile>.gz and removes <infile>.\n"
                        << "  -h, --help                   prints this message 
and exits.\n"
-                       << "  --load FILE                  loads the save FILE 
from the standard save\n"
+                       << "  -l, --load <file>            loads the save 
<file> from the standard save\n"
                        << "                               game directory.\n"
 #ifndef DISABLE_EDITOR2
-                       << "                               When launching the 
map editor via -e, the map FILE is\n"
-                       << "                               loaded, relative to 
the current directory.\n"
+                       << "                               When launching the 
map editor via -e, the map\n"
+                       << "                               <file> is loaded, 
relative to the current\n"
+                       << "                               directory.\n"
 #endif
-                       << "  --with-replay                replays the file 
SAVEGAME loaded with --load option.\n"
                        << "  --log-<level>=<domain1>,<domain2>,...\n"
                        << "                               sets the severity 
level of the log domains.\n"
                        << "                               'all' can be used to 
match any log domain.\n"
                        << "                               Available levels: 
error, warning, info, debug.\n"
                        << "                               By default the 
'error' level is used.\n"
-                       << "  --logdomains                 List defined log 
domains and exit.\n"
+                       << "  --logdomains                 lists defined log 
domains and exits.\n"
+                       << "  --max-fps                    the maximum fps the 
game tries to run at. Values\n"
+                       << "                               should be between 1 
and 1000, the default is 50.\n"
+                       << "  -m, --multiplayer            starts a multiplayer 
game. There are additional\n"
+                       << "                               options that can be 
used as explained below:\n"
+                       << "    --algorithm<number>=value  selects a 
non-standard algorithm to be used by\n"
+                       << "                               the AI controller 
for this side.\n"
+                       << "    --controller<number>=value selects the 
controller for this side.\n"
+                       << "    --era=value                selects the era to 
be played in by its id.\n"
+                       << "    --exit-at-end              exit Wesnoth at the 
end of the scenario.\n"
+                       << "    --nogui                    runs the game 
without the GUI. Must appear before\n"
+                       << "                               --multiplayer to 
have the desired effect.\n"
+                       << "    --parm<number>=name:value  sets additional 
parameters for this side.\n"
+                       << "    --scenario=value           selects a 
multiplayer scenario. The default\n"
+                       << "                               scenario is 
\"multiplayer_The_Freelands\".\n"
+                       << "    --side<number>=value       selects a faction of 
the current era for this\n"
+                       << "                               side by id.\n"
+                       << "    --turns=value              sets the number of 
turns. The default is \"50\".\n"
+                       << "  --no-delay                   runs the game 
without any delays.\n"
                        << "  --nocache                    disables caching of 
game data.\n"
-                       << "  --validcache                 assume that cache is 
valid (dangerous)\n"
+                       << "  --nomusic                    runs the game 
without music.\n"
                        << "  --nosound                    runs the game 
without sounds and music.\n"
-                       << "  --nomusic                    runs the game 
without only music.\n"
-                       << "  --max-fps                    the maximum fps the 
game tries to run at the value\n"
-                       << "                               should be between 
the 1 and 1000, the default is 50.\n"
-                       << "  --config-path                prints the path to 
the game config directory and exits.\n"
-                       << "  --config-dir=<path>          set name of game 
config directory.\n"
-                       << "  --path                       prints the path to 
the game data directory and exits.\n"
+                       << "  --path                       prints the path to 
the data directory and exits.\n"
 #ifdef HAVE_PYTHON
-                       << "  --python-api                 prints the runtime 
documentation for the python API.\n"
+                       << "  --python-api                 prints the runtime 
documentation for the python\n"
+                       << "                               API.\n"
 #endif
                        << "  -r, --resolution XxY         sets the screen 
resolution. Example: -r 800x600\n"
-                       << "  --smallgui                   allow to use screen 
resolutions down to 800x480\n"
-                       << "                               and resize few 
interface elements.\n"
+                       << "  --smallgui                   allows to use screen 
resolutions down to 800x480\n"
+                       << "                               and resizes a few 
interface elements.\n"
+                       << "  -s, --server [<host>]        connects to the host 
if specified\n"
+                       << "                               or to the first host 
in your preferences.\n"
                        << "  -t, --test                   runs the game in a 
small test scenario.\n"
+                       << "  --validcache                 assumes that the 
cache is valid. (dangerous)\n"
                        << "  -v, --version                prints the game's 
version number and exits.\n"
                        << "  -w, --windowed               runs the game in 
windowed mode.\n"
-                       << "  --no-delay                   run the game without 
any delays.\n"
-                       << "  -c, --campaign               skip menu, and go 
directly to campaign selection menu.\n"
-                       << "  -s, --server [host]          skip menu, and 
connect to the host if specified\n"
-                       << "                               or to the first host 
in your preferences.\n"
-                       << "  -m, --multiplayer            runs a multiplayer 
game. There are additional\n"
-                       << "                               options that can be 
used as explained below:\n"
-                       << "  --algorithm<number>=value    selects a 
non-standard algorithm to be used by the\n"
-                       << "                               AI controller for 
this side.\n"
-                       << "  --controller<number>=value   selects the 
controller for this side.\n"
-                       << "  --era=value                  selects the era to 
be played in by its id.\n"
-                       << "  --nogui                      runs the game 
without the GUI. Must appear before\n"
-                       << "                               --multiplayer to 
have the desired effect.\n"
-                       << "  --parm<number>=name:value    sets additional 
parameters for this side.\n"
-                       << "  --scenario=value             selects a 
multiplayer scenario. The default\n"
-                       << "                               scenario is 
\"multiplayer_The_Freelands\".\n"
-                       << "  --side<number>=value         selects a faction of 
the current era for this side\n"
-                       << "                               by id.\n"
-                       << "  --turns=value                sets the number of 
turns. The default is \"50\".\n"
-                       << "  --exit-at-end                exit Wesnoth at end 
of scenario.\n"
-                       << "  --dummylocales               Enable dummylocales 
for switching to non-system locale.\n"
-                       << "  --new-widgets                there is a new WIP 
widget toolkit this switch enables the new toolkit\n"
-                       << "                               (VERY EXPERIMENTAL 
don't file bug reports since most are known).\n"
-                       << "                               Parts of the library 
are deemed stable and will work without this switch.\n"
+                       << "  --with-replay                replays the file 
loaded with the --load option.\n"
+                       << "\n"
+                       << "  --new-widgets                there is a new WIP 
widget toolkit this switch\n"
+                       << "                               enables the new 
toolkit (VERY EXPERIMENTAL don't\n"
+                       << "                               file bug reports 
since most are known).\n"
+                       << "                               Parts of the library 
are deemed stable and will\n"
+                       << "                               work without this 
switch.\n"
                        ;
                        return 0;
                } else if(val == "--version" || val == "-v") {


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to