Skip to content

Commit ab682a3

Browse files
committed
Allow multiple -t/--table parameters on the command line
Specifying multiple tables using the -t/--table parameter on the command line now opens all of them in different tabs.
1 parent 539657e commit ab682a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Application.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Application::Application(int& argc, char** argv) :
7878

7979
// Parse command line
8080
QString fileToOpen;
81-
QString tableToBrowse;
81+
std::vector<QString> tableToBrowse;
8282
QStringList sqlToExecute;
8383
bool readOnly = false;
8484
m_dontShowMainWindow = false;
@@ -115,7 +115,7 @@ Application::Application(int& argc, char** argv) :
115115
if(++i >= arguments().size())
116116
qWarning() << qPrintable(tr("The -t/--table option requires an argument"));
117117
else
118-
tableToBrowse = arguments().at(i);
118+
tableToBrowse.push_back(arguments().at(i));
119119
} else if(arguments().at(i) == "-q" || arguments().at(i) == "--quit") {
120120
m_dontShowMainWindow = true;
121121
} else if(arguments().at(i) == "-R" || arguments().at(i) == "--read-only") {
@@ -178,8 +178,8 @@ Application::Application(int& argc, char** argv) :
178178
m_mainWindow->refresh();
179179

180180
// Jump to table if the -t/--table parameter was set
181-
if(!tableToBrowse.isEmpty())
182-
m_mainWindow->switchToBrowseDataTab(sqlb::ObjectIdentifier("main", tableToBrowse.toStdString()));
181+
for(const QString& t : tableToBrowse)
182+
m_mainWindow->switchToBrowseDataTab(sqlb::ObjectIdentifier("main", t.toStdString()));
183183
}
184184
}
185185
}

0 commit comments

Comments
 (0)