summaryrefslogtreecommitdiff
path: root/src/vtcol.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/vtcol.rs')
-rw-r--r--src/vtcol.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/vtcol.rs b/src/vtcol.rs
index 256d137..9a78d2f 100644
--- a/src/vtcol.rs
+++ b/src/vtcol.rs
@@ -187,8 +187,7 @@ impl<'a> Job
match matches.subcommand() {
("dump", Some(subm)) => {
if let Some(b64) = subm.value_of("base64") {
- let scheme =
- Palette::from_base64(&b64).map(Scheme::from)?;
+ let scheme = Scheme::from_base64(b64)?;
return Ok(Self::Dump(scheme));
}
if let Some(name) = subm.value_of("scheme") {
@@ -200,8 +199,7 @@ impl<'a> Job
("list", _) => Ok(Self::List),
("set", Some(subm)) => {
if let Some(b64) = subm.value_of("base64") {
- let scheme =
- Palette::from_base64(&b64).map(Scheme::from)?;
+ let scheme = Scheme::from_base64(&b64)?;
return Ok(Self::Set(scheme));
}
let scheme = match subm.value_of("scheme") {
@@ -353,16 +351,14 @@ impl<'a> Job
let fd = Console::current()?;
vrb!("console fd: {}", fd);
+ let scm = fd.current_scheme()?;
if b64 {
- let pal = fd.current_palette()?;
- println!("{}", pal.base64());
+ print!("{}", scm.base64()?);
+ } else {
+ vrb!("active scheme:");
+ println!("{}", scm);
}
- let scm = fd.current_scheme()?;
-
- vrb!("active scheme:");
- println!("{}", scm);
-
Ok(())
}