diff options
| author | Arne Dußin | 2021-01-08 15:57:52 +0100 |
|---|---|---|
| committer | Arne Dußin | 2021-01-08 15:57:52 +0100 |
| commit | 60327dd3ef85a263173e6275cb122c9191c030fe (patch) | |
| tree | 670c2729ade91daadee62dae37faa828ab70b3f4 | |
| parent | d8123704ea4fe4f1fb677db31ecac53c9c40096e (diff) | |
| download | graf_karto-60327dd3ef85a263173e6275cb122c9191c030fe.tar.gz graf_karto-60327dd3ef85a263173e6275cb122c9191c030fe.zip | |
Rename save to write for vim mnemonics compatibility
| -rw-r--r-- | src/cli/cmd/mod.rs | 6 | ||||
| -rw-r--r-- | src/cli/cmd/write.rs (renamed from src/cli/cmd/save.rs) | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/cli/cmd/mod.rs b/src/cli/cmd/mod.rs index 42e865a..e00b895 100644 --- a/src/cli/cmd/mod.rs +++ b/src/cli/cmd/mod.rs @@ -2,11 +2,11 @@ pub mod edit; pub mod read; -pub mod save; +pub mod write; pub use edit::*; pub use read::*; -pub use save::*; +pub use write::*; use crate::Editor; use std::ops::RangeInclusive; @@ -35,7 +35,7 @@ pub fn parse_command(string: &str) -> Result<Box<dyn Command>, CmdParseError> { let parts: Vec<&str> = string.split_whitespace().collect(); match parts[0] { - "w" => Ok(Box::new(Save::from_args(&parts[1..])?)), + "w" => Ok(Box::new(Write::from_args(&parts[1..])?)), "e" => Ok(Box::new(Edit::from_args(&parts[1..])?)), "r" => Ok(Box::new(Read::from_args(&parts[1..])?)), other => Err(CmdParseError::NoSuchCmd(other.to_owned())), diff --git a/src/cli/cmd/save.rs b/src/cli/cmd/write.rs index 2c022cf..399045c 100644 --- a/src/cli/cmd/save.rs +++ b/src/cli/cmd/write.rs @@ -8,11 +8,11 @@ use std::path::PathBuf; /// The save command can take any destination in the filesystem the user can write to. Processing /// will then save the map contents to that destination, overwriting anything that may be there. -pub struct Save { +pub struct Write { destination: PathBuf, } -impl FromArgs for Save { +impl FromArgs for Write { fn from_args(args: &[&str]) -> Result<Self, CmdParseError> { if args.len() != 1 { return Err(CmdParseError::WrongNumberOfArgs(args.len(), 1..=1)); @@ -24,7 +24,7 @@ impl FromArgs for Save { } } -impl Command for Save { +impl Command for Write { fn process(&self, editor: &mut Editor) -> Result<String, String> { let data = MapData::extract_data(editor.map()); |
