summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vtcol.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/vtcol.rs b/src/vtcol.rs
index 8b86e07..122b471 100644
--- a/src/vtcol.rs
+++ b/src/vtcol.rs
@@ -463,6 +463,17 @@ impl<'a> Job
),
)
.subcommand(
+ SubCommand::with_name("edit")
+ .about("launch a graphical color scheme editor")
+ .arg(
+ Arg::with_name("scheme")
+ .help("name of the scheme to edit")
+ .required(false)
+ .value_name("NAME")
+ .takes_value(true),
+ ),
+ )
+ .subcommand(
SubCommand::with_name("list")
.about("list builtin schemes"),
)
@@ -786,6 +797,20 @@ impl<'a> Job
}
Err(anyhow!("dump requires an argument"))
},
+ ("edit", Some(subm)) => {
+ #[cfg(feature = "gui")]
+ if let Some(name) = subm.value_of("scheme") {
+ let scm = Scheme::from(name);
+ Ok(Self(con, Subcmd::Colors(ColorJob::Dump(scm))))
+ } else {
+ todo!() /* generate generic name */
+ }
+ #[cfg(not(feature = "gui"))]
+ Err(anyhow!(
+ "the ``edit'' subcommand requires vtcol to be \
+ built with the the ``gui'' feature"
+ ))
+ },
("list", _) =>
Ok(Self(con, Subcmd::Colors(ColorJob::List))),
("set", Some(subm)) => {