From 2038947a14d32d89da2bdbcaa1381c3015ac9c7a Mon Sep 17 00:00:00 2001 From: Kunal Mohan Date: Sun, 16 May 2021 16:42:50 +0530 Subject: Big refactor: separate crates for client, server and utilities --- zellij-utils/src/cli.rs | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 zellij-utils/src/cli.rs (limited to 'zellij-utils/src/cli.rs') diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs new file mode 100644 index 000000000..861a736cd --- /dev/null +++ b/zellij-utils/src/cli.rs @@ -0,0 +1,51 @@ +use crate::consts::{ZELLIJ_CONFIG_DIR_ENV, ZELLIJ_CONFIG_FILE_ENV}; +use crate::input::options::Options; +use crate::setup::Setup; +use serde::{Deserialize, Serialize}; +use std::path::PathBuf; +use structopt::StructOpt; + +#[derive(StructOpt, Default, Debug, Clone, Serialize, Deserialize)] +#[structopt(name = "zellij")] +pub struct CliArgs { + /// Maximum panes on screen, caution: opening more panes will close old ones + #[structopt(long)] + pub max_panes: Option, + + /// Change where zellij looks for layouts and plugins + #[structopt(long, parse(from_os_str))] + pub data_dir: Option, + + /// Run server listening at the specified socket path + #[structopt(long, parse(from_os_str))] + pub server: Option, + + /// Path to a layout yaml file + #[structopt(short, long, parse(from_os_str))] + pub layout: Option, + + /// Change where zellij looks for the configuration + #[structopt(short, long, env=ZELLIJ_CONFIG_FILE_ENV, parse(from_os_str))] + pub config: Option, + + /// Change where zellij looks for the configuration + #[structopt(long, env=ZELLIJ_CONFIG_DIR_ENV, parse(from_os_str))] + pub config_dir: Option, + + #[structopt(subcommand)] + pub option: Option, + + #[structopt(short, long)] + pub debug: bool, +} + +#[derive(Debug, StructOpt, Clone, Serialize, Deserialize)] +pub enum ConfigCli { + /// Change the behaviour of zellij + #[structopt(name = "options")] + Options(Options), + + /// Setup zellij and check its configuration + #[structopt(name = "setup")] + Setup(Setup), +} -- cgit v1.2.3