Git commit 378230eaa955d6915ad2a1b7792855595b598e05 by Aaron Seigo. Committed on 10/01/2016 at 11:09. Pushed by aseigo into branch 'feature/akonadish_gointeractive'. make it possible to enter itneractive mode from a script use case -> you want to set the default log and debug levels away from the defaults and then go into interactive mode: set logging warning go_interactive M +17 -0 akonadish/main.cpp http://commits.kde.org/akonadi-next/378230eaa955d6915ad2a1b7792855595b598e05 diff --git a/akonadish/main.cpp b/akonadish/main.cpp index af85a94..4c00b9b 100644 --- a/akonadish/main.cpp +++ b/akonadish/main.cpp @@ -39,6 +39,10 @@ = int enterRepl() { + if (State::hasEventLoop()) { + return 0; + } + Repl *repl =3D new Repl; QObject::connect(repl, &QStateMachine::finished, repl, &QObject::deleteLater); @@ -51,8 +55,21 @@ int enterRepl() return rv; } = +bool goInteractive(const QStringList &, State &) +{ + enterRepl(); + return true; +} + +Syntax::List goInteractiveSyntax() +{ + Syntax interactive("go_interactive", QString(), &goInteractive); + return Syntax::List() << interactive; +} + void processCommandStream(QTextStream &stream) { + SyntaxTree::self()->registerSyntax(&goInteractiveSyntax); QString line =3D stream.readLine(); while (!line.isEmpty()) { line =3D line.trimmed();