diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index fa22cc1..2f49049 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,13 +3,32 @@ #include <QApplication> #include <QUrl> #include <QSettings> +#include <QCommandLineParser> +#include <QDebug> int main(int argc, char *argv[]) { QApplication app(argc, argv); + QCommandLineParser cli_parser; + cli_parser.parse(app.arguments()); + MainWindow w(&app); - w.addEmptyTab(true, true); + + auto urls = cli_parser.positionalArguments(); + if(urls.size() > 0) { + for(auto url_str : urls) { + QUrl url { url_str }; + if(url.isValid()) { + w.addNewTab(false, url); + } else { + qDebug() << "Invalid url: " << url_str; + } + } + } + else { + w.addEmptyTab(true, true); + } w.show(); return app.exec(); |
