diff options
author | Canop <cano.petrole@gmail.com> | 2022-02-23 13:29:43 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2022-02-23 13:29:43 +0100 |
commit | 912872d806b3b3f51375b60e6c8aaaf8000864bb (patch) | |
tree | ce3439e1a3b100ffea8be3d87361a153ede6fdab | |
parent | acf48b34550a7ebb7735857452ba2f6ada10977c (diff) |
fix failure in parsing --cols arg with underscore
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/col.rs | 2 | ||||
-rw-r--r-- | src/cols.rs | 6 |
5 files changed, 10 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 45e3590..8b02e0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +### next +- fix failure in parsing `--cols` arguments with underscore <a name="v2.0.2"></a> ### v2.0.2 - 2022/02/23 @@ -243,7 +243,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lfs" -version = "2.0.2" +version = "2.0.3-dev" dependencies = [ "argh", "crossterm", @@ -1,6 +1,6 @@ [package] name = "lfs" -version = "2.0.2" +version = "2.0.3-dev" authors = ["dystroy <denys.seguret@gmail.com>"] edition = "2021" keywords = ["linux", "filesystem", "fs"] @@ -95,7 +95,7 @@ impl Col { Self::Free => Alignment::Right, Self::Size => Alignment::Right, Self::InodesUsed => Alignment::Right, - Self::InodesUse => Alignment::Center, + Self::InodesUse => Alignment::Right, Self::InodesFree => Alignment::Right, Self::InodesCount => Alignment::Right, Self::MountPoint => Alignment::Left, diff --git a/src/cols.rs b/src/cols.rs index a9c4637..5ad5e81 100644 --- a/src/cols.rs +++ b/src/cols.rs @@ -74,7 +74,7 @@ impl FromStr for Cols { let mut tokens: Vec<String> = Vec::new(); let mut must_create = true; for c in value.chars() { - if c.is_alphabetic() { + if c.is_alphabetic() || c == '_' { if must_create { tokens.push(c.into()); must_create = false; @@ -273,6 +273,10 @@ mod cols_parsing { "default-fs+inodes", vec![Disk, Type, Used, Use, Free, Size, MountPoint, InodesUse] ); + check( + "+inodes_used+inodes_free", + vec![Filesystem, Disk, Type, Used, Use, Free, Size, MountPoint, InodesUsed, InodesFree] + ); } } |