Changeset 7254 in orxonox.OLD for branches/preferences/src/lib
- Timestamp:
- Mar 29, 2006, 4:50:51 PM (19 years ago)
- Location:
- branches/preferences/src/lib/parser/preferences
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.cc
r7253 r7254 71 71 cbd->parser->showHelp(); 72 72 return true; 73 case ID_LICENSE:74 PRINT(0)(ORXONOX_LICENSE_SHORT);75 return true;76 73 } 77 74 78 if ( entry.id >= ID_ LAST && entry.id - ID_LAST< regArgs.size() )75 if ( entry.id >= ID_PREFS && entry.id - ID_PREFS < regArgs.size() ) 79 76 { 80 if ( regArgs[entry.id - ID_ LAST].value == "%arg%" )77 if ( regArgs[entry.id - ID_PREFS].value == "%arg%" ) 81 78 { 82 79 assert( argArgs.size() == 1 ); 83 80 84 81 cbd->iniEntries.push_back( IniEntry() ); 85 cbd->iniEntries.back().section = regArgs[entry.id - ID_ LAST].section;86 cbd->iniEntries.back().key = regArgs[entry.id - ID_ LAST].key;82 cbd->iniEntries.back().section = regArgs[entry.id - ID_PREFS].section; 83 cbd->iniEntries.back().key = regArgs[entry.id - ID_PREFS].key; 87 84 cbd->iniEntries.back().value = argArgs[0].getString(); 88 85 } … … 90 87 { 91 88 cbd->iniEntries.push_back( IniEntry() ); 92 cbd->iniEntries.back().section = regArgs[entry.id - ID_ LAST].section;93 cbd->iniEntries.back().key = regArgs[entry.id - ID_ LAST].key;94 cbd->iniEntries.back().value = regArgs[entry.id - ID_ LAST].value;89 cbd->iniEntries.back().section = regArgs[entry.id - ID_PREFS].section; 90 cbd->iniEntries.back().key = regArgs[entry.id - ID_PREFS].key; 91 cbd->iniEntries.back().value = regArgs[entry.id - ID_PREFS].value; 95 92 } 96 93 } … … 109 106 110 107 parser.add( ID_HELP, "help", 'h', 0, "", "Shows this help"); 111 parser.add( ID_LICENSE, "license", 'l', 0, "", "Prints the licence and exit");112 108 113 109 for ( int i = 0; i<regArgs.size(); i++ ) … … 115 111 if ( regArgs[i].value == "%arg%" ) 116 112 { 117 parser.add( ID_ LAST+ i, regArgs[i].longOption, regArgs[i].shortOption, 1, regArgs[i].argName, regArgs[i].help );113 parser.add( ID_PREFS + i, regArgs[i].longOption, regArgs[i].shortOption, 1, regArgs[i].argName, regArgs[i].help ); 118 114 } 119 115 else 120 116 { 121 parser.add( ID_ LAST+ i, regArgs[i].longOption, regArgs[i].shortOption, 0, "", regArgs[i].help );117 parser.add( ID_PREFS + i, regArgs[i].longOption, regArgs[i].shortOption, 0, "", regArgs[i].help ); 122 118 } 123 119 } -
branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.h
r7253 r7254 9 9 #include "stdincl.h" 10 10 #include "debug.h" 11 #include "globals.h"12 11 13 12 #include "src/lib/parser/cmdline_parser/cmdline_parser.h" … … 43 42 ID_SET_INI = 1, 44 43 ID_HELP, 45 ID_LICENSE, 46 ID_LAST 44 ID_PREFS 47 45 }; 48 46
Note: See TracChangeset
for help on using the changeset viewer.