cli: Prevent initializing shell completion if not required

This commit is contained in:
Martchus 2018-01-10 19:50:21 +01:00
parent eeca6715de
commit cccc73407c
1 changed files with 8 additions and 0 deletions

View File

@ -762,6 +762,10 @@ void Application::requestResumePwd(const ArgumentOccurrence &)
void Application::initDirCompletion(Argument &arg, const ArgumentOccurrence &)
{
// prevent this initialization if we're not in shell completion mode
if (m_argsRead) {
return;
}
// load config and wait for connected
loadConfig();
waitForConnected(2000);
@ -771,6 +775,10 @@ void Application::initDirCompletion(Argument &arg, const ArgumentOccurrence &)
void Application::initDevCompletion(Argument &arg, const ArgumentOccurrence &)
{
// prevent this initialization if we're not in shell completion mode
if (m_argsRead) {
return;
}
// load config and wait for connected
loadConfig();
waitForConnected(2000);