Changes between Version 1 and Version 2 of code/doc/CommandLine
- Timestamp:
- Sep 4, 2008, 7:49:14 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/doc/CommandLine
v1 v2 18 18 == Retrieving a value == 19 19 Getting the values is quite easy via the static interface of the CommandLine class. Use getArgument(name) to retrieve the entire argument including the information whether the default value was used or not (i.e. argument given in command line or not). And use getValue(name, *value) to get the value directly. [[br]] 20 Be careful with the types. If you declare an argument as (int), you will have to retrieve it with an (int)-type variable. 20 Be careful with the types. If you declare an argument as (int), you will have to retrieve it with an (int)-type variable. An example: 21 {{{ 22 int myVar; 23 CommandLine::getValue("port", &myVar); 24 25 CommandLineArgument<int>* myArg = CommandLine::getArgument<int>("port); 26 }}} 21 27 22 28 == Passing command line parameters ==