From 2fc6cefb950f1e1cfd5a002cf361858a963ef013 Mon Sep 17 00:00:00 2001 From: Jae-Heon Ji <32578710+jaeheonji@users.noreply.github.com> Date: Mon, 24 Oct 2022 00:46:01 +0900 Subject: [PATCH] chore: add help to cli options (#1839) --- zellij-utils/src/cli.rs | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs index 153c8ede..0525c038 100644 --- a/zellij-utils/src/cli.rs +++ b/zellij-utils/src/cli.rs @@ -127,14 +127,23 @@ pub enum Sessions { /// Run a command in a new pane #[clap(visible_alias = "r")] Run { + /// Command to run #[clap(last(true), required(true))] command: Vec, + + /// Direction to open the new pane in #[clap(short, long, value_parser, conflicts_with("floating"))] direction: Option, + + /// Change the working directory of the new pane #[clap(long, value_parser)] cwd: Option, + + /// Open the new pane in floating mode #[clap(short, long, value_parser, default_value("false"), takes_value(false))] floating: bool, + + /// Name of the new pane #[clap(short, long, value_parser)] name: Option, }, @@ -142,10 +151,16 @@ pub enum Sessions { #[clap(visible_alias = "e")] Edit { file: PathBuf, + + /// Open the file in the specified line number #[clap(short, long, value_parser)] line_number: Option, + + /// Direction to open the new pane in #[clap(short, long, value_parser, conflicts_with("floating"))] direction: Option, + + /// Open the new pane in floating mode #[clap(short, long, value_parser, default_value("false"), takes_value(false))] floating: bool, }, @@ -180,9 +195,11 @@ pub enum CliAction { /// Change the location of the focused pane in the specified direction /// [right|left|up|down] MovePane { direction: Direction }, - /// Dumps the pane scrollback to a file + /// Dump the focused pane to a file DumpScreen { path: PathBuf, + + /// Dump the pane with full scrollback #[clap(short, long, value_parser, default_value("false"), takes_value(false))] full: bool, }, @@ -211,24 +228,38 @@ pub enum CliAction { /// Open a new pane in the specified direction [right|down] /// If no direction is specified, will try to use the biggest available space. NewPane { + /// Direction to open the new pane in #[clap(short, long, value_parser, conflicts_with("floating"))] direction: Option, + #[clap(last(true))] command: Vec, + + /// Change the working directory of the new pane #[clap(long, value_parser)] cwd: Option, + + /// Open the new pane in floating mode #[clap(short, long, value_parser, default_value("false"), takes_value(false))] floating: bool, + + /// Name of the new pane #[clap(short, long, value_parser)] name: Option, }, /// Open the specified file in a new zellij pane with your default EDITOR Edit { file: PathBuf, + + /// Direction to open the new pane in #[clap(short, long, value_parser, conflicts_with("floating"))] direction: Option, + + /// Open the file in the specified line number #[clap(short, long, value_parser)] line_number: Option, + + /// Open the new pane in floating mode #[clap(short, long, value_parser, default_value("false"), takes_value(false))] floating: bool, }, @@ -258,10 +289,15 @@ pub enum CliAction { UndoRenameTab, /// Create a new tab, optionally with a specified tab layout and name NewTab { + /// Layout to use for the new tab #[clap(short, long, value_parser)] layout: Option, + + /// Name of the new tab #[clap(short, long, value_parser)] name: Option, + + /// Change the working directory of the new tab #[clap(short, long, value_parser, requires("layout"))] cwd: Option, },