Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7357 for code


Ignore:
Timestamp:
Sep 5, 2010, 6:50:17 PM (14 years ago)
Author:
rgrieder
Message:

Changed command line arguments reference to a simple Doxygen page containing the usage information text.

Location:
code/branches/doc
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • code/branches/doc/doc/api/CMakeLists.txt

    r7356 r7357  
    5555    OUTPUT ${INTERNAL_DOCFILE}
    5656    COMMAND orxonox-main
    57     ARGS --noIOConsole --generateDoc --docFile ${INTERNAL_DOCFILE}
     57    ARGS --noIOConsole --generateDoc ${INTERNAL_DOCFILE}
    5858    WORKING_DIRECTORY ${_working_dir}
    5959    COMMENT "Generating additional Doxygen documentation from Orxonox executable"
  • code/branches/doc/doc/api/Groups.dox

    r7335 r7357  
    6161    @defgroup CmdArgs Commandline Arguments
    6262    @ingroup Command
    63     @brief For a reference see @ref cmdargs
     63    @brief For a reference see @ref cmdargspage
    6464*/
    6565
  • code/branches/doc/doc/api/doxy.config.in

    r7356 r7357  
    191191# You can put \n's in the value part of an alias to insert newlines.
    192192
    193 ALIASES                = "cmdarg=\xrefitem cmdargs \"Commandline Argment\" \"Commandline Arguments Reference\""
     193ALIASES                =
    194194
    195195# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
  • code/branches/doc/src/libraries/core/CommandLineParser.cc

    r7335 r7357  
    4141namespace orxonox
    4242{
    43     //! @cmdarg
    4443    SetCommandLineOnlyArgument(optionsFile, "start.ini").shortcut("o");
    4544
     
    315314    }
    316315
     316    void CommandLineParser::generateDoc(std::ofstream& file)
     317    {
     318        file << "/** @page cmdargspage Command Line Arguments Reference" << endl;
     319        file << "    @verbatim"; /*no endl*/
     320        file << getUsageInformation(); /*no endl*/
     321        file << "    @endverbatim" << endl;
     322        file << "*/" << endl;
     323    }
     324
    317325    /**
    318326    @brief
     
    320328        The method throws an exception if 'name' was not found or the value could not be converted.
    321329    @note
    322         You shold of course not call this method before the command line has been parsed.
     330        You should of course not call this method before the command line has been parsed.
    323331    */
    324332    const CommandLineArgument* CommandLineParser::getArgument(const std::string& name)
  • code/branches/doc/src/libraries/core/CommandLineParser.h

    r7303 r7357  
    3232#include "CorePrereqs.h"
    3333
     34#include <fstream>
    3435#include <map>
    3536#include "util/OrxAssert.h"
     
    164165
    165166        static void destroyAllArguments();
     167
     168        static void generateDoc(std::ofstream& file);
    166169
    167170    private:
  • code/branches/doc/src/libraries/core/Core.cc

    r7335 r7357  
    3737
    3838#include <cassert>
     39#include <fstream>
    3940#include <vector>
    4041
     
    7778    Core* Core::singletonPtr_s  = 0;
    7879
    79     //! @cmdarg
    8080    SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
    81     //! @cmdarg
    8281    SetCommandLineSwitch(noIOConsole).information("Use this if you don't want to use the IOConsole (for instance for Lua debugging)");
    8382
    8483#ifdef ORXONOX_PLATFORM_WINDOWS
    85     //! @cmdarg
    8684    SetCommandLineArgument(limitToCPU, 1).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is the first core (faster than off)");
    8785#endif
     
    174172        // Create singletons that always exist (in other libraries)
    175173        this->rootScope_.reset(new Scope<ScopeID::Root>());
     174
     175        // Generate documentation instead of normal run?
     176        std::string docFilename;
     177        CommandLineParser::getValue("generateDoc", &docFilename);
     178        if (!docFilename.empty())
     179        {
     180            std::ofstream docFile(docFilename.c_str());
     181            if (docFile.is_open())
     182            {
     183                CommandLineParser::generateDoc(docFile);
     184                docFile.close();
     185            }
     186            else
     187                COUT(0) << "Error: Could not open file for documentation writing" << endl;
     188        }
    176189    }
    177190
  • code/branches/doc/src/libraries/core/Core.h

    r7266 r7357  
    3333#include "CorePrereqs.h"
    3434
    35 #include <cassert>
    3635#include <string>
    3736#include <boost/scoped_ptr.hpp>
  • code/branches/doc/src/libraries/core/PathConfig.cc

    r7335 r7357  
    7070    PathConfig* PathConfig::singletonPtr_s  = 0;
    7171
    72     //! @cmdarg
    7372    SetCommandLineArgument(externalDataPath, "").information("Path to the external data files");
    74     //! @cmdarg
    7573    SetCommandLineOnlyArgument(writingPathSuffix, "").information("Additional subfolder for config and log files");
    7674
  • code/branches/doc/src/libraries/core/input/InputManager.cc

    r7335 r7357  
    6060namespace orxonox
    6161{
    62     //! @cmdarg
    6362    SetCommandLineSwitch(keyboard_no_grab).information("Whether not to exclusively grab the keyboard");
    6463
  • code/branches/doc/src/orxonox/LevelManager.cc

    r7335 r7357  
    4242namespace orxonox
    4343{
    44     //! @cmdarg
    4544    SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)");
    4645
  • code/branches/doc/src/orxonox/Main.cc

    r7353 r7357  
    4848namespace orxonox
    4949{
    50     //! @cmdarg
    5150    SetCommandLineSwitch(console).information("Start in console mode (text IO only)");
    52     //! @cmdarg
    5351    SetCommandLineSwitch(server).information("Start in server mode");
    54     //! @cmdarg
    5552    SetCommandLineSwitch(client).information("Start in client mode");
    56     //! @cmdarg
    5753    SetCommandLineSwitch(dedicated).information("Start in dedicated server mode");
    58     //! @cmdarg
    5954    SetCommandLineSwitch(standalone).information("Start in standalone mode");
    60     //! @cmdarg
    6155    SetCommandLineSwitch(dedicatedClient).information("Start in dedicated client mode");
    6256
    63     //! @cmdarg
    64     SetCommandLineSwitch(generateDoc)
     57    SetCommandLineArgument(generateDoc, "")
    6558        .information("Generates a Doxygen file from things like SetConsoleCommand");
    66     //! @cmdarg
    67     SetCommandLineArgument(docFile, "Internal.dox")
    68         .information("Name of the doc file to be generated with --generateDoc");
    6959
    7060    /**
     
    7666        Game* game = new Game(strCmdLine);
    7767
    78         if (CommandLineParser::getValue("generateDoc").getBool())
    79         {
    80             // Generate additional documentation written to ONE file
    81             std::string filename;
    82             CommandLineParser::getValue("docFile", &filename);
    83         }
    84         else
     68        if (CommandLineParser::getValue("generateDoc").getString().empty())
    8569        {
    8670            game->setStateHierarchy(
     
    9680            game->requestState("root");
    9781
    98             // Some development hacks (not really, but in the future, this calls won't make sense anymore)
     82            // Some development hacks (not really, but in the future, these calls won't make sense anymore)
    9983            if (CommandLineParser::getValue("standalone").getBool())
    10084                Game::getInstance().requestStates("graphics, standalone, level");
  • code/branches/doc/src/orxonox/gamestates/GSClient.cc

    r7335 r7357  
    4040    DeclareGameState(GSClient, "client", false, false);
    4141
    42     //! @cmdarg
    4342    SetCommandLineArgument(dest, "127.0.0.1").information("Server hostname/IP (IP in the form of #.#.#.#)");
    4443
  • code/branches/doc/src/orxonox/gamestates/GSServer.cc

    r7335 r7357  
    3939    DeclareGameState(GSServer, "server", false, false);
    4040
    41     //! @cmdarg
    4241    SetCommandLineArgument(port, 55556).shortcut("p").information("Network communication port to be used 0-65535 (default: 55556)");
    4342
Note: See TracChangeset for help on using the changeset viewer.