<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>src/psicli.h</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -39,7 +39,7 @@
 #include &lt;time.h&gt;
 #include &quot;profiledlg.h&quot;
 #include &quot;activeprofiles.h&quot;
-#include &quot;simplecli.h&quot;
+#include &quot;psicli.h&quot;
 #include &quot;psioptions.h&quot;
 
 #include &quot;eventdlg.h&quot;
@@ -80,61 +80,6 @@
 
 using namespace XMPP;
 
-class PsiCli : public SimpleCli
-{
-public:
-	PsiCli() {
-		defineParam(&quot;profile&quot;, tr(&quot;PROFILE&quot;), tr(&quot;Activate program instance running specified profile. &quot;
-							 &quot;Otherwise, open new instance using this profile &quot;
-							 &quot;(unless used together with --remote).&quot;));
-		defineSwitch(&quot;remote&quot;, tr(&quot;Force remote-control mode. &quot;
-					  &quot;If there is no running instance, &quot;
-					  &quot;or --profile was specified but there is no instance using it, &quot;
-					  &quot;exit without doing anything.&quot;));
-		defineParam(&quot;uri&quot;, tr(&quot;URI&quot;), tr(&quot;Open XMPP URI. (e.g. xmpp:someone@example.org?chat) &quot;
-						 &quot;For security reasons, this must be the last option.&quot;));
-		defineParam(&quot;status&quot;, tr(&quot;SHOW&quot;), tr(&quot;Set status. SHOW must be one of `online', `chat', `away', `xa', `dnd', `offline'.&quot;,
-						     &quot;Please do not translate `online', `chat', etc.&quot;));
-		defineParam(&quot;status-message&quot;, tr(&quot;MSG&quot;), tr(&quot;Set status message. Must be used together with --status.&quot;));
-		defineSwitch(&quot;help&quot;, tr(&quot;Show this help message and exit.&quot;));
-		defineAlias(&quot;h&quot;, &quot;help&quot;);
-		defineAlias(&quot;?&quot;, &quot;help&quot;);
-		defineSwitch(&quot;version&quot;, tr(&quot;Show version information and exit.&quot;));
-		defineAlias(&quot;v&quot;, &quot;version&quot;);
-	}
-
-	void showHelp(int textWidth = 78) {
-		QString output;
-		QString u = tr(&quot;Usage:&quot;) + &quot; &quot; + QFileInfo(QApplication::applicationFilePath()).fileName();
-		output += wrap(u + &quot; [--profile=PROFILE] [--remote] [--status=SHOW\t[--status-message=MSG]] [--uri=URI]&quot;,
-			       textWidth, u.length() + 1, 0).replace('\t', ' '); // non-breakable space ;)
-		output += '\n';
-		output += tr(&quot;Psi - The Cross-Platform Jabber/XMPP Client For Power Users&quot;);
-		output += &quot;\n\n&quot;;
-		output += tr(&quot;Options:&quot;);
-		output += '\n';
-		output += optionsHelp(textWidth);
-		output += '\n';
-		output += tr(&quot;Go to &lt;http://psi-im.org/&gt; for more information about Psi.&quot;);
-		show(output);
-	}
-
-	void showVersion() {
-		show(QString(&quot;%1 %2\nQt %3\n&quot;)
-			.arg(ApplicationInfo::name()).arg(ApplicationInfo::version())
-			.arg(qVersion())
-			+QString(tr(&quot;Compiled with Qt %1&quot;, &quot;%1 will contain Qt version number&quot;))
-			.arg(QT_VERSION_STR));
-	}
-
-	void show(const QString&amp; text) {
-#ifdef Q_WS_WIN
-		QMessageBox::information(0, ApplicationInfo::name(), text);
-#else
-		puts(qPrintable(text));
-#endif
-	}
-};
 
 PsiMain::PsiMain(const QMap&lt;QString, QString&gt;&amp; commandline, QObject *par)
 	: QObject(par)
@@ -169,6 +114,10 @@ PsiMain::PsiMain(const QMap&lt;QString, QString&gt;&amp; commandline, QObject *par)
 		PsiCli().showVersion();
 		QTimer::singleShot(0, this, SLOT(bail()));
 	}
+	else if(cmdline.contains(&quot;choose-profile&quot;)) {
+		// Select a profile
+		QTimer::singleShot(0, this, SLOT(chooseProfile()));
+	}
 	else if(cmdline.contains(&quot;profile&quot;) &amp;&amp; profileExists(cmdline[&quot;profile&quot;])) {
 		// Open profile from commandline
 		activeProfile = lastProfile = cmdline[&quot;profile&quot;];
@@ -509,7 +458,7 @@ int main(int argc, char *argv[])
 #endif
 
 	// check if we want to remote-control other psi instance
-	if (!cmdline.contains(&quot;help&quot;) &amp;&amp; !cmdline.contains(&quot;version&quot;)
+	if (!cmdline.contains(&quot;help&quot;) &amp;&amp; !cmdline.contains(&quot;version&quot;) &amp;&amp; !cmdline.contains(&quot;choose-profile&quot;)
 		&amp;&amp; ActiveProfiles::instance()-&gt;isAnyActive()
 		&amp;&amp; ((cmdline.contains(&quot;profile&quot;) &amp;&amp; ActiveProfiles::instance()-&gt;isActive(cmdline[&quot;profile&quot;])) || !cmdline.contains(&quot;profile&quot;))) {
 </diff>
      <filename>src/main.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -224,7 +224,8 @@ HEADERS += \
 	$$PWD/accountlabel.h \
 	$$PWD/psiactions.h \
 	$$PWD/bookmarkmanagedlg.h \
-	$$PWD/vcardphotodlg.h
+	$$PWD/vcardphotodlg.h \
+	$$PWD/psicli.h
 
 
 HEADERS += tabcompletion.h</diff>
      <filename>src/src.pri</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>107faf0433a0ad8ecbfc91e28046613a752d0d31</id>
    </parent>
  </parents>
  <author>
    <name>Maciek Niedzielski</name>
    <email>machekku@psi-im.org</email>
  </author>
  <url>http://github.com/mblsha/psi/commit/588bace0623115d4a3a8eb79708eca3909d47d81</url>
  <id>588bace0623115d4a3a8eb79708eca3909d47d81</id>
  <committed-date>2009-10-27T12:07:55-07:00</committed-date>
  <authored-date>2009-10-27T12:07:55-07:00</authored-date>
  <message>Small CLI update (mostly new --choose-profile)</message>
  <tree>9aa58a01751f4f605b10fac876adf15975bd6d5b</tree>
  <committer>
    <name>Maciek Niedzielski</name>
    <email>machekku@psi-im.org</email>
  </committer>
</commit>
