aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2022-11-04 16:00:22 +0100
committerThomas Voss <mail@thomasvoss.com> 2022-11-04 16:00:22 +0100
commit362aa847cb6b724f51dc39c3060bc45efa8f79cd (patch)
tree2e63042891d2bc1ab7de9bac24504d8bc52721b6 /src/error.rs
parente0676b3bb80f2fe1d0c2bb8e6979fd07bcba52e8 (diff)
Require atleast one parameter to be provided
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 06bfbbe..f303780 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -8,6 +8,7 @@ pub enum Error {
BadLengths,
DuplicateElems(Vec<String>),
IOError(io::Error),
+ NoArgs,
NoEditor,
SpawnFailed(String, io::Error),
}
@@ -21,6 +22,7 @@ impl Display for Error {
|d| writeln!(f, "{p}: Multiple files named \"{}\" specified", d)
),
Self::IOError(e) => writeln!(f, "{p}: {e}"),
+ Self::NoArgs => writeln!(f, "Usage: {p} file ..."),
Self::NoEditor => writeln!(f, "{p}: \"EDITOR\" environment variable is not set"),
Self::SpawnFailed(ed, e) => writeln!(f, "{p}: Failed to spawn editor \"{ed}\": {e}")
}