diff options
author | Canop <cano.petrole@gmail.com> | 2023-07-02 21:16:38 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2023-07-02 21:16:38 +0200 |
commit | 0e0ce4aa04c2100e113a49d6993df65f6bbd6f3c (patch) | |
tree | ffa1347f3f1fa730ed817d1a3a2fa57a68478c1d | |
parent | 70e0375d09b36c523cf1e54617aeebaf103ff8e1 (diff) |
fix bad filtering on the 'disk' column
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | src/col_expr.rs | 3 | ||||
-rw-r--r-- | src/csv.rs | 2 | ||||
-rw-r--r-- | src/filter.rs | 1 | ||||
-rw-r--r-- | src/main.rs | 1 |
9 files changed, 18 insertions, 9 deletions
@@ -6,3 +6,4 @@ /trav /deploy.sh /graphics +/.bacon-locations diff --git a/CHANGELOG.md b/CHANGELOG.md index dad36bb..d3ba2d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +<a name="v2.6.1"></a> +### v2.6.1 - 2023/07/02 +- lfs renamed to dysk +- fix bad filtering on the 'disk' column + <a name="v2.6.0"></a> ### v2.6.0 - 2022/10/19 - you can get the "precise" number of bytes with `--units bytes` - Fix #51 @@ -173,7 +173,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dysk" -version = "2.6.0" +version = "2.6.1" dependencies = [ "argh", "bet", @@ -1,6 +1,6 @@ [package] name = "dysk" -version = "2.6.0" +version = "2.6.1" authors = ["dystroy <denys.seguret@gmail.com>"] edition = "2021" keywords = ["linux", "filesystem", "fs", "lfs", "disk"] @@ -26,25 +26,25 @@ Complete documentation lives at **[https://dystroy.org/dysk](https://dystroy.org ### Default table -![screenshot](website/docs/img/standard.png) +![screenshot](website/docs/img/dysk.png) ### Custom choice of column -![screenshot](website/docs/img/c=label+default+dev.png) +![screenshot](website/docs/img/dysk_c=label+default+dev.png) ### JSON output -![screenshot](website/docs/img/json-jq-tour.png) +![screenshot](website/docs/img/dysk-json-jq.png) (you can output the table as CSV too) ### Filters -![screenshot](website/docs/img/filters.png) +![screenshot](website/docs/img/dysk_filters.png) ### Sort -![screenshot](website/docs/img/s=free-d.png) +![screenshot](website/docs/img/dysk_s=free-d.png) diff --git a/src/col_expr.rs b/src/col_expr.rs index aa3841c..2abf476 100644 --- a/src/col_expr.rs +++ b/src/col_expr.rs @@ -98,7 +98,7 @@ impl ColExpr { parse_bool(&self.value)?, ), Col::Disk => self.operator.eval_option_str( - mount.disk.as_ref().map(|d| d.name.as_str()), + mount.disk.as_ref().map(|d| d.disk_type()), &self.value, ), Col::Used => self.operator.eval_option( @@ -229,6 +229,7 @@ fn test_col_filter_parsing() { } #[derive(Debug, PartialEq)] +#[allow(clippy::enum_variant_names)] pub enum EvalExprError { NotANumber(String), NotAnId(String), @@ -59,7 +59,7 @@ pub fn print(mounts: &[&Mount], args: &Args) -> Result<(), std::io::Error> { for mount in mounts { for col in args.cols.cols() { match col { - Col::Id => csv.cell(&mount.info.id), + Col::Id => csv.cell(mount.info.id), Col::Dev => csv.cell(format!("{}:{}", mount.info.dev.major, mount.info.dev.minor)), Col::Filesystem => csv.cell(&mount.info.fs), Col::Label => csv.cell_opt(mount.fs_label.as_ref()), diff --git a/src/filter.rs b/src/filter.rs index 7db7ce2..85ba80a 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -22,6 +22,7 @@ pub struct Filter { } impl Filter { + #[allow(clippy::match_like_matches_macro)] pub fn eval(&self, mount: &Mount) -> Result<bool, EvalExprError> { self.expr.eval_faillible( // leaf evaluation diff --git a/src/main.rs b/src/main.rs index d905bd9..4daaca4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,6 +23,7 @@ use { }, }; +#[allow(clippy::match_like_matches_macro)] fn main() { let args: Args = argh::from_env(); if args.version { |