aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
authordenis <denismaximov98@gmail.com>2021-05-01 13:45:01 +0300
committerdenis <denismaximov98@gmail.com>2021-05-01 13:45:01 +0300
commiteabecde90b1617ce4c29be9d5af3f52ccb67e45f (patch)
tree0d0dafa594269045f084383a9719f2a4995fe7ea /src/cli.rs
parentwip: more cleaning up (diff)
parentdocs(changelog): performance improvements (diff)
downloadsl0ppij-eabecde90b1617ce4c29be9d5af3f52ccb67e45f.tar.gz
sl0ppij-eabecde90b1617ce4c29be9d5af3f52ccb67e45f.tar.xz
sl0ppij-eabecde90b1617ce4c29be9d5af3f52ccb67e45f.zip
chore: painless merge this time
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 008fb28c..bc4e4a9e 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1,9 +1,7 @@
+use super::common::utils::consts::{ZELLIJ_CONFIG_DIR_ENV, ZELLIJ_CONFIG_FILE_ENV};
use std::path::PathBuf;
use structopt::StructOpt;
-// TODO add to consts.rs
-const ZELLIJ_CONFIG_ENV: &str = "ZELLIJ_CONFIG";
-
#[derive(StructOpt, Default, Debug)]
#[structopt(name = "zellij")]
pub struct CliArgs {
@@ -32,9 +30,13 @@ pub struct CliArgs {
pub layout: Option<PathBuf>,
/// Change where zellij looks for the configuration
- #[structopt(short, long, env=ZELLIJ_CONFIG_ENV)]
+ #[structopt(short, long, env=ZELLIJ_CONFIG_FILE_ENV)]
pub config: Option<PathBuf>,
+ /// Change where zellij looks for the configuration
+ #[structopt(long, env=ZELLIJ_CONFIG_DIR_ENV)]
+ pub config_dir: Option<PathBuf>,
+
#[structopt(subcommand)]
pub option: Option<ConfigCli>,
@@ -47,8 +49,19 @@ pub enum ConfigCli {
/// Change the behaviour of zellij
#[structopt(name = "option")]
Config {
- #[structopt(long)]
/// Disables loading of configuration file at default location
+ #[structopt(long)]
clean: bool,
},
+
+ #[structopt(name = "generate-completion")]
+ GenerateCompletion { shell: String },
+
+ #[structopt(name = "setup")]
+ Setup {
+ /// Disables loading of configuration file at default location
+ /// Dump the default configuration file to stdout
+ #[structopt(long)]
+ dump_config: bool,
+ },
}