mirror of
https://gitlab.com/hyask/swaysome.git
synced 2025-12-10 07:44:43 +01:00
simplify clap structures
This commit is contained in:
parent
6d8c19e8a7
commit
99a99648b1
1 changed files with 8 additions and 20 deletions
28
src/main.rs
28
src/main.rs
|
|
@ -37,24 +37,24 @@ struct Cli {
|
||||||
#[derive(Subcommand, Debug)]
|
#[derive(Subcommand, Debug)]
|
||||||
enum Command {
|
enum Command {
|
||||||
#[clap(about = "Initialize the workspace groups for all the outputs")]
|
#[clap(about = "Initialize the workspace groups for all the outputs")]
|
||||||
Init(InitAction),
|
Init(Index),
|
||||||
|
|
||||||
#[clap(about = "Move the focused container to another workspace on the same workspace group")]
|
#[clap(about = "Move the focused container to another workspace on the same workspace group")]
|
||||||
Move(MoveAction),
|
Move(Index),
|
||||||
|
|
||||||
#[clap(
|
#[clap(
|
||||||
about = "Move the focused container to the same workspace index on another workspace group"
|
about = "Move the focused container to the same workspace index on another workspace group"
|
||||||
)]
|
)]
|
||||||
MoveToGroup(MoveAction),
|
MoveToGroup(Index),
|
||||||
|
|
||||||
#[clap(about = "Focus to another workspace on the same workspace group")]
|
#[clap(about = "Focus to another workspace on the same workspace group")]
|
||||||
Focus(FocusAction),
|
Focus(Index),
|
||||||
|
|
||||||
#[clap(about = "Focus to workspace group")]
|
#[clap(about = "Focus to workspace group")]
|
||||||
FocusGroup(FocusAction),
|
FocusGroup(Index),
|
||||||
|
|
||||||
#[clap(about = "Focus to another workspace on all the outputs")]
|
#[clap(about = "Focus to another workspace on all the outputs")]
|
||||||
FocusAllOutputs(FocusAction),
|
FocusAllOutputs(Index),
|
||||||
|
|
||||||
#[clap(about = "Move the focused container to the next output")]
|
#[clap(about = "Move the focused container to the next output")]
|
||||||
NextOutput,
|
NextOutput,
|
||||||
|
|
@ -73,20 +73,8 @@ enum Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Args, Debug)]
|
#[derive(Args, Debug)]
|
||||||
struct InitAction {
|
struct Index {
|
||||||
#[clap(value_name = "index", help = "The index to initialize with")]
|
#[clap(value_name = "index", help = "The workspace index to work with")]
|
||||||
index: usize,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Args, Debug)]
|
|
||||||
struct FocusAction {
|
|
||||||
#[clap(value_name = "index", help = "The index to focus on")]
|
|
||||||
index: usize,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Args, Debug)]
|
|
||||||
struct MoveAction {
|
|
||||||
#[clap(value_name = "index", help = "The index to move the container to")]
|
|
||||||
index: usize,
|
index: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue