Skip to content

Commit

Permalink
Remove support for --save (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
denisidoro committed Apr 15, 2021
1 parent 217841c commit 5c23e25
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
4 changes: 0 additions & 4 deletions src/actor.rs
Expand Up @@ -13,7 +13,6 @@ use crate::structures::config::Config;
use anyhow::Context;
use anyhow::Error;

use std::fs;
use std::io::Write;
use std::path::Path;
use std::process::{Command, Stdio};
Expand Down Expand Up @@ -207,9 +206,6 @@ pub fn act(
Action::Print => {
println!("{}", interpolated_snippet);
}
Action::Save(filepath) => {
fs::write(filepath, interpolated_snippet).context("Unable to save output")?;
}
Action::Execute => match key {
"ctrl-y" => {
clipboard::copy(interpolated_snippet)?;
Expand Down
9 changes: 1 addition & 8 deletions src/structures/config.rs
Expand Up @@ -91,10 +91,6 @@ pub struct Config {
#[clap(short, long, env = env_var::PATH)]
pub path: Option<String>,

/// [Experimental] Instead of executing a snippet, saves it to a file
#[clap(short, long)]
save: Option<String>,

/// Instead of executing a snippet, prints it to stdout
#[clap(long)]
print: bool,
Expand Down Expand Up @@ -214,7 +210,6 @@ pub enum Source {
}

pub enum Action {
Save(String),
Print,
Execute,
}
Expand All @@ -231,9 +226,7 @@ impl Config {
}

pub fn action(&self) -> Action {
if let Some(filepath) = self.save.clone() {
Action::Save(filepath)
} else if self.print {
if self.print {
Action::Print
} else {
Action::Execute
Expand Down

0 comments on commit 5c23e25

Please sign in to comment.