summaryrefslogtreecommitdiffstats
path: root/src/verb/verb_execution.rs
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2020-09-29 16:56:46 +0200
committerCanop <cano.petrole@gmail.com>2020-09-29 16:56:46 +0200
commitc0b0b283dc2b24c3469339ebf61c28fda1e0efbb (patch)
treeca0dd838237e7a46e660d94f3f918fac4417ace5 /src/verb/verb_execution.rs
parent46316405917f92e622cdb6e0b29dd769afb65206 (diff)
refactor verb initialization from conf
removing the useless step of VerbConf and VerbConfExecutionType
Diffstat (limited to 'src/verb/verb_execution.rs')
-rw-r--r--src/verb/verb_execution.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/verb/verb_execution.rs b/src/verb/verb_execution.rs
index 6390598..0a950b8 100644
--- a/src/verb/verb_execution.rs
+++ b/src/verb/verb_execution.rs
@@ -1,4 +1,7 @@
-use super::*;
+use {
+ super::*,
+ std::fmt,
+};
/// how a verb must be executed
#[derive(Debug, Clone)]
@@ -15,3 +18,14 @@ pub enum VerbExecution {
/// to broot with --cmd
Sequence(SequenceExecution),
}
+
+impl fmt::Display for VerbExecution {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ Self::Internal(ie) => ie.fmt(f),
+ Self::External(ee) => ee.exec_pattern.fmt(f),
+ Self::Sequence(se) => se.sequence.raw.fmt(f),
+ }
+ }
+}
+