Rearrange CLI subcommands a bit

This commit is contained in:
Ivan Molodetskikh 2024-05-17 11:22:52 +04:00
parent 36d3e70f11
commit 4dc7a6ceb8

View File

@ -32,12 +32,6 @@ pub struct Cli {
#[derive(Subcommand)] #[derive(Subcommand)]
pub enum Sub { pub enum Sub {
/// Validate the config file.
Validate {
/// Path to config file (default: `$XDG_CONFIG_HOME/niri/config.kdl`).
#[arg(short, long)]
config: Option<PathBuf>,
},
/// Communicate with the running niri instance. /// Communicate with the running niri instance.
Msg { Msg {
#[command(subcommand)] #[command(subcommand)]
@ -46,16 +40,22 @@ pub enum Sub {
#[arg(short, long)] #[arg(short, long)]
json: bool, json: bool,
}, },
/// Validate the config file.
Validate {
/// Path to config file (default: `$XDG_CONFIG_HOME/niri/config.kdl`).
#[arg(short, long)]
config: Option<PathBuf>,
},
/// Cause a panic to check if the backtraces are good. /// Cause a panic to check if the backtraces are good.
Panic, Panic,
} }
#[derive(Subcommand)] #[derive(Subcommand)]
pub enum Msg { pub enum Msg {
/// Print the version of the running niri instance.
Version,
/// List connected outputs. /// List connected outputs.
Outputs, Outputs,
/// List workspaces.
Workspaces,
/// Print information about the focused window. /// Print information about the focused window.
FocusedWindow, FocusedWindow,
/// Perform an action. /// Perform an action.
@ -78,8 +78,8 @@ pub enum Msg {
#[command(subcommand)] #[command(subcommand)]
action: OutputAction, action: OutputAction,
}, },
/// List workspaces. /// Print the version of the running niri instance.
Workspaces, Version,
/// Request an error from the running niri instance. /// Request an error from the running niri instance.
RequestError, RequestError,
} }