mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-27 19:02:47 +01:00
start is the same dance in all three komorebic: look whether komorebi is running, start it, wait three seconds and look again, give up after three attempts by running it in front of the user so its stderr can be read. launcher::start runs that loop over a Launcher (daemon_name, spawn, is_running, diagnose) that each platform implements by hand; what follows a successful start (companions, the licence text) stays in each komorebic, as does stop's handling of companions, whose order differs per platform; only stop_message(ignore_restore) is shared. The loop flushes standard output after 'Waiting for ... to start...' (KDE did, macOS and Windows did not) and puts the same space after it; both are invisible in the text printed. Nothing uses it yet. Verified: native cargo test -p komorebic-core: 31 passed, 0 failed (4 new launcher tests with a fake launcher: already running, second try, three tries then diagnose, stop message).
21 lines
938 B
Rust
21 lines
938 B
Rust
//! The command line of `komorebic`, in one place for the three platforms.
|
|
//!
|
|
//! Every definition is plain clap code that is always compiled, with no `cfg`: what differs per
|
|
//! platform is a type parameter, so one binary can render the help of all of them.
|
|
//!
|
|
//! - [`args`] has the argument blocks the subcommands are built from.
|
|
//! - [`cli`] has [`cli::Opts`], the command line of a platform, generic over its own subcommands.
|
|
//! - [`launcher`] has the part of `start` and `stop` that is the same on every platform.
|
|
//! - [`messages`] has the subcommands that are one message to the daemon.
|
|
//! - [`pan`] reads the stream of touchpad gestures that `komorebic pan --stream` is given.
|
|
//! - [`platform`] has the subcommands of each platform that are not in [`messages`].
|
|
//! - [`docgen`] renders the pages of `docs/cli`.
|
|
|
|
pub mod args;
|
|
pub mod cli;
|
|
pub mod docgen;
|
|
pub mod launcher;
|
|
pub mod messages;
|
|
pub mod pan;
|
|
pub mod platform;
|