31 enum Commands { CommandHelp, CommandClear, CommandMenu, CommandHistory, CommandExit, CommandUndefined };
35 std::atomic<bool> m_running =
true;
37 std::shared_ptr<AuthCliService> m_authCliService;
38 std::shared_ptr<UserApi> m_userApi;
39 std::shared_ptr<CommandLineUtils> m_commandLineUtils;
41 std::shared_ptr<IInputService> m_inputService;
42 std::shared_ptr<ITerminalService> m_terminalService;
43 std::shared_ptr<CommandLineHistoryService> m_commandLineHistoryService;
44 std::optional<std::string> m_helpComponentName;
47 std::string menuNameOf();
50 void onComponentCommand(
const std::string &
input,
const std::vector<std::string> &
flags);
53 void onCommand(
const std::string &
input,
const std::vector<std::string> &
flags);
79 std::shared_ptr<UserApi>
userApi,
83 const std::shared_ptr<ProcessName> &processName,
CommandLineService(const std::vector< std::shared_ptr< CommandLineComponent > > &components, std::shared_ptr< AuthCliService > authCliService, std::shared_ptr< UserApi > userApi, std::shared_ptr< CommandLineUtils > commandLineUtils, std::shared_ptr< IInputService > inputService, std::shared_ptr< ITerminalService > terminalService, const std::shared_ptr< ProcessName > &processName, std::shared_ptr< CommandLineHistoryService > commandLineHistoryService)