pub(crate) fn ParseArguments() -> (Option<String>, Option<String>, Option<Command>)Expand description
Parse command line arguments into daemon config or CLI command
Handles two modes of operation:
- CLI mode: Execute commands like
status,restart,config, etc. - Daemon mode: Start the background service with optional config/bind args
§Arguments
Returns a tuple of (config_path, bind_address, optional_command)
- If
commandis Some, daemon startup should be skipped - Otherwise, start daemon with provided config path and bind address
§TODO
- Add validation for bind address format
- Add validation for config file exists/readable
- Support
--validate-configflag to check config without starting - Add
--daemonflag to force daemon mode with CLI commands - Make flags case-insensitive
- Add –no-daemon flag for foreground operation