Module startup

Module startup 

Source
Expand description

CLI startup orchestration for winbrew-cli.

This module owns the pre-dispatch portion of the command lifecycle. The crate entrypoint crate::run_app delegates here so startup policy stays with the CLI layer instead of leaking into winbrew-bin.

The workflow is intentionally split into three phases:

  1. Load the persisted configuration from storage.
  2. Build a crate::CommandContext from that configuration and the current verbosity level.
  3. Initialize process services and dispatch the selected command.

The order is important because:

  • configuration must be loaded before the effective log and database paths are known;
  • logging must start before later startup failures are emitted;
  • database initialization must happen before runtime cleanup, because the bootstrap cleanup uses crate::database::get_conn;
  • command dispatch runs last, after the process is fully hydrated.

Modulesยง

config ๐Ÿ”’
Configuration capture for CLI startup.
process ๐Ÿ”’
Process-global service initialization for CLI startup.

Functionsยง

dispatch_command ๐Ÿ”’
Hand the hydrated context to the CLI dispatcher after startup side effects have completed.
run ๐Ÿ”’
Run the full CLI startup sequence and then execute the selected command.