autocommit 2022-04-02 00:31:30 CEST
This commit is contained in:
parent
2dd433aa04
commit
6ad6d83b7e
34 changed files with 446 additions and 161 deletions
11
src/cli.rs
11
src/cli.rs
|
|
@ -1,6 +1,7 @@
|
|||
mod generate;
|
||||
mod log;
|
||||
mod quit;
|
||||
mod set_log_level;
|
||||
|
||||
use crate::compositor::start_compositor;
|
||||
use ::log::Level;
|
||||
|
|
@ -31,6 +32,8 @@ pub enum Cmd {
|
|||
GenerateCompletion(GenerateArgs),
|
||||
/// Open the log file.
|
||||
Log(LogArgs),
|
||||
/// Sets the log level.
|
||||
SetLogLevel(SetLogArgs),
|
||||
/// Stop the compositor.
|
||||
Quit,
|
||||
}
|
||||
|
|
@ -61,6 +64,13 @@ pub struct LogArgs {
|
|||
pager_end: bool,
|
||||
}
|
||||
|
||||
#[derive(Args, Debug)]
|
||||
pub struct SetLogArgs {
|
||||
/// The new log level.
|
||||
#[clap(arg_enum)]
|
||||
level: CliLogLevel,
|
||||
}
|
||||
|
||||
#[derive(ArgEnum, Debug, Copy, Clone, Hash)]
|
||||
pub enum CliBackend {
|
||||
X11,
|
||||
|
|
@ -108,5 +118,6 @@ pub fn main() {
|
|||
Cmd::GenerateCompletion(g) => generate::main(g),
|
||||
Cmd::Log(a) => log::main(cli.global, a),
|
||||
Cmd::Quit => quit::main(cli.global),
|
||||
Cmd::SetLogLevel(a) => set_log_level::main(cli.global, a),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue