summaryrefslogtreecommitdiffstats
path: root/src/output/tree.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/output/tree.rs')
-rw-r--r--src/output/tree.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/output/tree.rs b/src/output/tree.rs
new file mode 100644
index 0000000..be3f550
--- /dev/null
+++ b/src/output/tree.rs
@@ -0,0 +1,26 @@
+#[derive(PartialEq, Debug, Clone)]
+pub enum TreePart {
+
+ /// Rightmost column, *not* the last in the directory.
+ Edge,
+
+ /// Not the rightmost column, and the directory has not finished yet.
+ Line,
+
+ /// Rightmost column, and the last in the directory.
+ Corner,
+
+ /// Not the rightmost column, and the directory *has* finished.
+ Blank,
+}
+
+impl TreePart {
+ pub fn ascii_art(&self) -> &'static str {
+ match *self {
+ TreePart::Edge => "├──",
+ TreePart::Line => "│ ",
+ TreePart::Corner => "└──",
+ TreePart::Blank => " ",
+ }
+ }
+}