comparison src/main.cpp @ 765:cc2ba63d6005

Opening a file via command line call is possible without any parameter prefix now. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@1042 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Wed, 13 Apr 2011 06:12:15 +0000
parents 5a0ece4b81b4
children 431756c6e342
comparison
equal deleted inserted replaced
764:f9b070eedd40 765:cc2ba63d6005
108 /*! 108 /*!
109 /brief Entry point to UniversalIndentGUI application. 109 /brief Entry point to UniversalIndentGUI application.
110 110
111 Evaluates the following parameters: 111 Evaluates the following parameters:
112 No parameters starts without server and full gui. 112 No parameters starts without server and full gui.
113 -f filename --file filename : Opens the by filename defined file on start. 113 A string without any parameter prefix will be loaded as file on start.
114 -p --plugin : Run as plugin. Server will be started with a simplified gui. 114 -p --plugin : Run as plugin. Server will be started with a simplified gui.
115 -s --server : Run as server only without gui. 115 -s --server : Run as server only without gui.
116 If -p and -s are set, -p will be used. 116 If -p and -s are set, -p will be used.
117 -v --verbose needs a following parameter defining the verbose level as a number from 0 to 3. 117 -v --verbose needs a following parameter defining the verbose level as a number from 0 to 3.
118 */ 118 */
119 int main(int argc, char *argv[]) { 119 int main(int argc, char *argv[]) {
120 QString file2OpenOnStart = ""; 120 QString file2OpenOnStart = "";
121 int verboseLevel = 1; 121 int verboseLevel = 1;
122 bool startAsPlugin = false; 122 bool startAsPlugin = false;
154 // Define the command line object. 154 // Define the command line object.
155 TCLAP::CmdLine cmd("If -p and -s are set, -p will be used.\nGiving no parameters starts full gui without server.", ' ', "UiGUI version " PROGRAM_VERSION_STRING " " PROGRAM_REVISION); 155 TCLAP::CmdLine cmd("If -p and -s are set, -p will be used.\nGiving no parameters starts full gui without server.", ' ', "UiGUI version " PROGRAM_VERSION_STRING " " PROGRAM_REVISION);
156 cmd.setExceptionHandling(false); 156 cmd.setExceptionHandling(false);
157 157
158 // Define a value argument and add it to the command line. 158 // Define a value argument and add it to the command line.
159 TCLAP::ValueArg<std::string> filenameArg("f", "file", "Opens the by filename defined file on start" , false, "", "string"); 159 TCLAP::UnlabeledValueArg<std::string> filenameArg("file", "Opens the by filename defined file on start" , false, "", "filename");
160 cmd.add( filenameArg ); 160 cmd.add( filenameArg );
161 161
162 // Define a switch and add it to the command line. 162 // Define a switch and add it to the command line.
163 TCLAP::SwitchArg pluginSwitch("p", "plugin", "Run as plugin. Server will be started with a simplified gui", false); 163 TCLAP::SwitchArg pluginSwitch("p", "plugin", "Run as plugin. Server will be started with a simplified gui", false);
164 cmd.add( pluginSwitch ); 164 cmd.add( pluginSwitch );