diff --git a/CHANGELOG.md b/CHANGELOG.md index fcc74d93..2470c2e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,93 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [3.1.0] - 2023-07-01 + +### [What's new](https://github.com/solidiquis/erdtree/pull/202) +- [Multiple configs with .erdtree.toml](https://github.com/solidiquis/erdtree/pull/201) +- [Increased performance with --suppress-size](https://github.com/solidiquis/erdtree/pull/203) +- [-x, --one-file-system](https://github.com/solidiquis/erdtree/pull/204) +- [Support for NO_COLOR](https://github.com/solidiquis/erdtree/pull/205) +- [Inverted flat layout](https://github.com/solidiquis/erdtree/pull/206) +- [Aliases: atime, ctime, and mtime](https://github.com/solidiquis/erdtree/pull/207) +- [ctrlc handler to restore cursor if progress indicator is enabled](https://github.com/solidiquis/erdtree/pull/210) + + +### [.erdtree.toml](https://github.com/solidiquis/erdtree/pull/201) + +First and foremost: + +**`.erdtreerc` is planned for deprecation by v3.3 so please migrate to `.erdtree.toml` by then.** + +There is now support for multiple configs: + +``` +-c, --config Use configuration of named table rather than the top-level table in .erdtree.toml +``` + +So given the following example `.erdtree.toml`: + +```toml +icons = true +human = true + +# Compute file sizes like `du` +[du] +disk_usage = "block" +icons = true +layout = "flat" +no-ignore = true +no-git = true +hidden = true +level = 1 + +# Do as `ls -l` +[ls] +icons = true +human = true +level = 1 +suppress-size = true +long = true +no-ignore = true +hidden = true + +# How many lines of Rust are in this code base? +[rs] +disk-usage = "line" +level = 1 +pattern = "\\.rs$" +``` + +``` +$ erd + +# equivalant to + +$ erd --human --icons +``` + +... + +``` +$ erd -c ls + +# equivalent to + +$ erd --icons --human --level 1 --suppress-size --long --no-ignore --hidden +``` + +etc. + +For further information on how to get started with the new `.erdtree.toml` please refer to the [README.md](README.md#toml-file). + +**NOTE**: +- Multiple configs are only supported via `.erdtree.toml`. +- If you have both a `.erdtree.toml` and `.erdtreerc` then the latter will take precedent. Attempts to use `--config` in said case will result in an error and a warning asking to migrate from `.erdtreerc` to `.erdtree.toml`. +- Again: **`.erdtreerc` will be deprecated in favor of `.erdtree.toml` by v3.3** + + ## [3.0.2] - 2023-06-12 +- Added support for `.erdtree.toml` ### Bug fixes - [Fixed segmentation fault that occurs with `--long` when file has an invalid user or group](https://github.com/solidiquis/erdtree/pull/193) diff --git a/Cargo.lock b/Cargo.lock index efe10645..0a6947e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,17 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.20" @@ -35,18 +46,44 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "bstr" version = "1.3.0" @@ -146,12 +183,40 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "config" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" +dependencies = [ + "async-trait", + "json5", + "lazy_static", + "nom", + "pathdiff", + "ron", + "rust-ini", + "serde", + "serde_json", + "toml", + "yaml-rust", +] + [[package]] name = "core-foundation-sys" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +[[package]] +name = "cpufeatures" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +dependencies = [ + "libc", +] + [[package]] name = "crossterm" version = "0.26.1" @@ -177,6 +242,26 @@ dependencies = [ "winapi", ] +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctrlc" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e" +dependencies = [ + "nix", + "windows-sys 0.48.0", +] + [[package]] name = "cxx" version = "1.0.94" @@ -221,6 +306,16 @@ dependencies = [ "syn 2.0.10", ] +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + [[package]] name = "dirs" version = "5.0.0" @@ -241,15 +336,23 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "dlv-list" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" + [[package]] name = "erdtree" -version = "3.0.2" +version = "3.1.0" dependencies = [ "ansi_term", "chrono", "clap", "clap_complete", + "config", "crossterm", + "ctrlc", "dirs", "errno 0.3.1", "filesize", @@ -322,6 +425,16 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.2.9" @@ -346,6 +459,15 @@ dependencies = [ "regex", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + [[package]] name = "heck" version = "0.4.1" @@ -443,6 +565,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + [[package]] name = "js-sys" version = "0.3.61" @@ -452,6 +580,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json5" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -473,6 +612,12 @@ dependencies = [ "cc", ] +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + [[package]] name = "linux-raw-sys" version = "0.1.4" @@ -520,6 +665,12 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "mio" version = "0.8.6" @@ -532,6 +683,28 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "nix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "static_assertions", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -567,6 +740,16 @@ version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +[[package]] +name = "ordered-multimap" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" +dependencies = [ + "dlv-list", + "hashbrown", +] + [[package]] name = "os_str_bytes" version = "6.4.1" @@ -602,6 +785,56 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "pest" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16833386b02953ca926d19f64af613b9bf742c48dcd5e09b32fbfc9740bf84e2" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7763190f9406839f99e5197afee8c9e759969f7dbfa40ad3b8dbee8757b745b5" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "249061b22e99973da1f5f5f1410284419e283bb60b79255bf5f42a94b66a2e00" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "pest_meta" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "457c310cfc9cf3f22bc58901cc7f0d3410ac5d6298e432a4f9a6138565cb6df6" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -681,6 +914,27 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "ron" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" +dependencies = [ + "base64", + "bitflags", + "serde", +] + +[[package]] +name = "rust-ini" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" +dependencies = [ + "cfg-if", + "ordered-multimap", +] + [[package]] name = "rustix" version = "0.36.9" @@ -709,6 +963,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + [[package]] name = "same-file" version = "1.0.6" @@ -735,6 +995,42 @@ name = "serde" version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.156" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_json" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] [[package]] name = "signal-hook" @@ -772,6 +1068,12 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strip-ansi-escapes" version = "0.1.1" @@ -872,6 +1174,27 @@ dependencies = [ "winapi", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + [[package]] name = "unicode-ident" version = "1.0.8" @@ -1179,3 +1502,12 @@ name = "windows_x86_64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] diff --git a/Cargo.toml b/Cargo.toml index c6eb1e4d..8f4d2878 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "erdtree" -version = "3.0.2" +version = "3.1.0" edition = "2021" authors = ["Benjamin Nguyen "] description = """ @@ -12,7 +12,7 @@ documentation = "https://github.com/solidiquis/erdtree" homepage = "https://github.com/solidiquis/erdtree" repository = "https://github.com/solidiquis/erdtree" keywords = ["tree", "find", "ls", "du", "commandline"] -exclude = ["assets/*", "scripts/*"] +exclude = ["assets/*", "scripts/*", "example/*"] readme = "README.md" license = "MIT" rust-version = "1.70.0" @@ -28,7 +28,9 @@ ansi_term = "0.12.1" chrono = "0.4.24" clap = { version = "4.1.1", features = ["derive"] } clap_complete = "4.1.1" +config = { version = "0.13.3", features = ["toml"] } crossterm = "0.26.1" +ctrlc = "3.4.0" dirs = "5.0" errno = "0.3.1" filesize = "0.2.0" diff --git a/README.md b/README.md index a37e6fba..48d4d300 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ You can think of `erdtree` as a little bit of `du`, `tree`, `find`, `wc` and `ls * [Installation](#installation) * [Documentation](#documentation) - [Configuration file](#configuration-file) + - [Toml file](#toml-file) + - [.erdtreerc](#erdtreerc) - [Hardlinks](#hardlinks) - [Symlinks](#symlinks) - [Disk usage](#disk-usage) @@ -48,6 +50,7 @@ You can think of `erdtree` as a little bit of `du`, `tree`, `find`, `wc` and `ls - [Redirecting output and colorization](#redirecting-output-and-colorization) - [Parallelism](#parallelism) - [Completions](#completions) + - [Same filesystem](#same-filesystem) * [Comparisons against similar programs](#comparisons-against-similar-programs) - [exa](#exa) - [dua](#dua) @@ -70,6 +73,9 @@ Arguments: Directory to traverse; defaults to current working directory Options: + -c, --config + Use configuration of named table rather than the top-level table in .erdtree.toml + -C, --color Mode of coloring output @@ -128,9 +134,9 @@ Options: Which kind of timestamp to use; modified by default Possible values: - - create: Timestamp showing when the file was created - - access: Timestamp showing when the file was last accessed - - mod: Timestamp showing when the file was last modified + - create: Time created (alias: ctime) + - access: Time last accessed (alias: atime) + - mod: Time last modified (alias: mtime) --time-format Which format to use for the timestamp; default by default @@ -198,7 +204,7 @@ Options: -T, --threads Number of threads to use - [default: 3] + [default: 10] -u, --unit Report disk usage in binary or SI units @@ -209,6 +215,9 @@ Options: - bin: Displays disk usage using binary prefixes - si: Displays disk usage using SI prefixes + -x, --one-file-system + Prevent traversal into directories that are on different filesystems + -y, --layout Which kind of layout to use when rendering the output @@ -218,6 +227,7 @@ Options: - regular: Outputs the tree with the root node at the bottom of the output - inverted: Outputs the tree with the root node at the top of the output - flat: Outputs a flat layout using paths rather than an ASCII tree + - iflat: Outputs an inverted flat layout with the root at the top of the output -., --hidden Show hidden files @@ -316,6 +326,82 @@ Other means of installation to come. If `erdtree`'s out-of-the-box defaults don't meet your specific requirements, you can set your own defaults using a configuration file. +The configuration file currently comes in two flavors: `.erdtreerc` (to be deprecated) and `.erdtree.toml`. If you have both, +`.erdtreerc` will take precedent and `.erdtree.toml` will be disregarded, but please **note that `.erdtreerc` will be deprecated in the near future.** There is +no reason to have both. + +#### TOML file + +`erdtree` will look for `.erdtree.toml in any of the following locations: + +On Unix-systems: + +``` +$ERDTREE_TOML_PATH +$XDG_CONFIG_HOME/erdtree/.erdtree.toml +$XDG_CONFIG_HOME/.erdtree.toml +$HOME/.config/erdtree/.erdtree.toml +$HOME/.erdtree.toml +``` + +On Windows: + +``` +%APPDATA%\erdtree\.erdtree.toml +``` + +[Here](example/.erdtree.toml) and below is an example of a valid `.erdtree.toml`: + +```toml +icons = true +human = true + +# Compute file sizes like `du` +# e.g. `erd --config du` +[du] +disk_usage = "block" +icons = true +layout = "flat" +no-ignore = true +no-git = true +hidden = true +level = 1 + +# Do as `ls -l` +# e.g. `erd --config ls` +[ls] +icons = true +human = true +level = 1 +suppress-size = true +long = true + +# How many lines of Rust are in this code base? +# e.g. `erd --config rs` +[rs] +disk-usage = "line" +level = 1 +pattern = "\\.rs$" +``` + +`.erdtree.toml` supports multiple configurations. The top-level table is the main config that will be applied without additional arguments. +If you wish to use a separate configuration, create a named table like `du` above, set your arguments, and invoke it like so: + +``` +$ erd --config du + +# equivalent to + +$ erd --disk-usage block --icons --layout flat --no-ignore --no-git --hidden --level 1 +``` + +As far as the arguments go there are only three rules you need to be aware of: +1. `.erdtree.toml` only accepts long-named arguments without the preceding "--". +2. Types are enforced, so numbers are expected to be numbers, booleans are expected to be booleans, strings are expected to be strings, and so on and so forth. +3. `snake_case` and `kebap-case` works. + +#### .erdtreerc + `erdtree` will look for a configuration file in any of the following locations: On Linux/Mac/Unix-like: @@ -333,24 +419,11 @@ The format of a config file is as follows: - Every line is an `erdtree` option/argument. - Lines starting with `#` are considered comments and are thus ignored. -Arguments passed to `erdtree` take precedence. If you have a config that you would like to ignore without deleting you can use `--no-config`. +Arguments passed to `erdtree` on the command-line will override those found in `.erdtreerc`. -Here is an example of a valid configuration file: - -``` -# Long argument ---icons ---human +[Click here](example/.erdtreerc) for an example `.erdtreerc`. -# or short argument --l - -# args can be passed like this --d logical - -# or like this ---unit=si -``` +**If you have a config that you would like to ignore without deleting you can use `--no-config`.** ### Hardlinks @@ -453,7 +526,7 @@ Additionally, the word and line-count of directories are the summation of all of ### Layouts -`erdtree` comes with three layouts: +`erdtree` comes with four layouts: ``` -y, --layout @@ -465,6 +538,7 @@ Additionally, the word and line-count of directories are the summation of all of - regular: Outputs the tree with the root node at the bottom of the output - inverted: Outputs the tree with the root node at the top of the output - flat: Outputs a flat layout using paths rather than an ASCII tree + - iflat: Outputs an inverted flat layout with the root at the top of the output ``` * The `inverted` layout a more traditional `tree`-like layout where the root node is at the very top of the output. @@ -602,13 +676,13 @@ Currently only available on Unix-like platforms. Support for Windows is planned. --octal Show permissions in numeric octal format instead of symbolic - --time