diff --git a/tom/include/tom/commands/command.hpp b/tom/include/tom/commands/command.hpp index 0c4ac5710..81cd9e067 100644 --- a/tom/include/tom/commands/command.hpp +++ b/tom/include/tom/commands/command.hpp @@ -19,7 +19,14 @@ namespace Orm class DatabaseConnection; } -namespace Tom::Commands +namespace Tom +{ +namespace Concerns +{ + class Confirmable; +} + +namespace Commands { /*! Positional argument item for a console command. */ @@ -43,6 +50,9 @@ namespace Tom::Commands { Q_DISABLE_COPY(Command) + // To access parser() + friend Concerns::Confirmable; + /*! Alias for the ConnectionResolverInterface. */ using ConnectionResolverInterface = Orm::ConnectionResolverInterface; @@ -173,7 +183,8 @@ namespace Tom::Commands return m_application; } -} // namespace Tom::Commands +} // namespace Commands +} // namespace Tom TINYORM_END_COMMON_NAMESPACE diff --git a/tom/src/tom/concerns/confirmable.cpp b/tom/src/tom/concerns/confirmable.cpp index 1a83a47bf..4d13adce1 100644 --- a/tom/src/tom/concerns/confirmable.cpp +++ b/tom/src/tom/concerns/confirmable.cpp @@ -28,7 +28,7 @@ bool Confirmable::confirmToProceed(const QString &warning, if (!shouldConfirm) return true; - if (const auto &parser = m_command.get().application().parser(); + if (const auto &parser = m_command.get().parser(); parser.optionNames().contains(force) && parser.isSet(force) ) return true;