Radix Relay
Hybrid mesh communications with Signal Protocol encryption
Loading...
Searching...
No Matches
radix_relay::cli_utils Namespace Reference

Classes

struct  app_state
 Runtime application state. More...
 
struct  cli_args
 Parsed command-line arguments. More...
 
class  tui_sink
 Custom spdlog sink that routes log messages to a display queue. More...
 

Typedefs

using tui_sink_mutex_t = tui_sink< std::mutex >
 Type alias for mutex-protected TUI sink.
 

Functions

auto configure_logging (const cli_args &args, std::shared_ptr< async::async_queue< core::events::display_filter_input_t > > display_queue=nullptr) -> void
 Configures spdlog logging based on CLI arguments.
 
auto print_app_banner (const app_state &state) -> void
 Prints the application startup banner.
 
auto print_available_commands () -> void
 Prints list of available interactive commands.
 
template<concepts::command_handler CmdHandler>
auto execute_cli_command (const cli_args &args, std::shared_ptr< CmdHandler > command_handler) -> bool
 Executes a command specified via CLI arguments.
 
auto setup_cli_app (CLI::App &app, cli_args &args) -> void
 Configures CLI11 application with command-line options.
 
auto parse_cli_args (int argc, char **argv) -> cli_args
 Parses command-line arguments into a cli_args structure.
 
auto validate_cli_args (const cli_args &args) -> bool
 Validates parsed command-line arguments for logical consistency.
 

Typedef Documentation

◆ tui_sink_mutex_t

Type alias for mutex-protected TUI sink.

Definition at line 63 of file tui_sink.hpp.

Function Documentation

◆ configure_logging()

auto radix_relay::cli_utils::configure_logging ( const cli_args args,
std::shared_ptr< async::async_queue< core::events::display_filter_input_t > >  display_queue = nullptr 
) -> void
inline

Configures spdlog logging based on CLI arguments.

Parameters
argsParsed command-line arguments
display_queueOptional queue for routing log messages to TUI

Definition at line 32 of file app_init.hpp.

◆ execute_cli_command()

template<concepts::command_handler CmdHandler>
auto radix_relay::cli_utils::execute_cli_command ( const cli_args args,
std::shared_ptr< CmdHandler >  command_handler 
) -> bool
inline

Executes a command specified via CLI arguments.

Template Parameters
CmdHandlerCommand handler type
Parameters
argsParsed CLI arguments
command_handlerHandler to execute commands
Returns
true if a command was executed, false otherwise

Definition at line 76 of file app_init.hpp.

References radix_relay::core::events::send::peer.

◆ parse_cli_args()

auto radix_relay::cli_utils::parse_cli_args ( int  argc,
char **  argv 
) -> cli_args
inline

Parses command-line arguments into a cli_args structure.

Parameters
argcArgument count from main()
argvArgument vector from main()
Returns
Parsed command-line arguments

Definition at line 44 of file cli_parser.hpp.

References radix_relay::platform::expand_tilde_path(), radix_relay::cli_utils::cli_args::identity_path, and setup_cli_app().

◆ print_app_banner()

auto radix_relay::cli_utils::print_app_banner ( const app_state state) -> void
inline

Prints the application startup banner.

Parameters
stateCurrent application state

Definition at line 49 of file app_init.hpp.

◆ print_available_commands()

auto radix_relay::cli_utils::print_available_commands ( ) -> void
inline

Prints list of available interactive commands.

Definition at line 60 of file app_init.hpp.

◆ setup_cli_app()

auto radix_relay::cli_utils::setup_cli_app ( CLI::App &  app,
cli_args args 
) -> void
inline

Configures CLI11 application with command-line options.

Parameters
appCLI11 application instance
argsStructure to populate with parsed arguments

Definition at line 63 of file cli_parser.hpp.

Referenced by parse_cli_args().

◆ validate_cli_args()

auto radix_relay::cli_utils::validate_cli_args ( const cli_args args) -> bool
inline

Validates parsed command-line arguments for logical consistency.

Parameters
argsParsed arguments to validate
Returns
true if arguments are valid, false otherwise

Definition at line 90 of file cli_parser.hpp.