lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::UserManagementCliComponent Class Reference

#include <UserManagementCliComponent.h>

Inheritance diagram for lintel::UserManagementCliComponent:
lintel::CommandLineComponent

Public Member Functions

 UserManagementCliComponent (std::shared_ptr< UserApi > userApi)
 
void onCommand (const UserDto &userDto, const std::string &input, const std::vector< std::string > &parameters) override
 
void onHelp () override
 
void onShowMenu () override
 
bool onMenu (const std::string &component) override
 
bool onExit () override
 
void printCommandList (std::set< std::string > menuAlias) override
 
std::vector< std::string > allCommandsOf () override
 
- Public Member Functions inherited from lintel::CommandLineComponent
 CommandLineComponent (std::string_view name, std::string_view alias)
 
virtual ~CommandLineComponent ()=default
 
std::string_view getName ()
 
std::string_view getAlias ()
 
virtual std::set< std::string > menuEntriesOf ()
 

Detailed Description

CLI component for user and group management

Constructor & Destructor Documentation

◆ UserManagementCliComponent()

lintel::UserManagementCliComponent::UserManagementCliComponent ( std::shared_ptr< UserApi >  userApi)
explicit
Parameters
userApiAPI for user and group operations

Member Function Documentation

◆ allCommandsOf()

std::vector< std::string > lintel::UserManagementCliComponent::allCommandsOf ( )
overridevirtual
Returns
vector of all command names

Implements lintel::CommandLineComponent.

◆ onCommand()

void lintel::UserManagementCliComponent::onCommand ( const UserDto &  userDto,
const std::string &  command,
const std::vector< std::string > &  parameters 
)
overridevirtual

Handle a command entered by the user

Implements lintel::CommandLineComponent.

◆ onExit()

bool lintel::UserManagementCliComponent::onExit ( )
overridevirtual
Returns
true if exit was confirmed

CommandLineService currently discards the result and exits either way; a component that can veto the exit overrides this.

Implements lintel::CommandLineComponent.

◆ onHelp()

void lintel::UserManagementCliComponent::onHelp ( )
overridevirtual

Show help for this component

Implements lintel::CommandLineComponent.

◆ onMenu()

bool lintel::UserManagementCliComponent::onMenu ( const std::string &  component)
overridevirtual
Parameters
componentname to navigate to; return true if handled

Reached with input that CommandParser could not classify, i.e. with a free-text line rather than a real command. CommandLineService prints "Invalid command" for a component that returns false, so a component without sub-menus returns false - returning true unconditionally would swallow every typo at the prompt without a word.

Implements lintel::CommandLineComponent.

◆ onShowMenu()

void lintel::UserManagementCliComponent::onShowMenu ( )
overridevirtual

Show the menu for this component

Implements lintel::CommandLineComponent.

◆ printCommandList()

void lintel::UserManagementCliComponent::printCommandList ( std::set< std::string >  menuAlias)
overridevirtual

Print the list of available commands

Implements lintel::CommandLineComponent.


The documentation for this class was generated from the following file: