Simple tool for automatic file management

ft: set default ordering for size filter

hauleth.dev 3dde8f9c a22c5503

verified
Changed files
+17 -3
cli
docs
+5 -1
cli/src/filters.rs
···
Greater,
}
+
impl Ordering {
+
fn default() -> std::cmp::Ordering { std::cmp::Ordering::Equal }
+
}
+
filter! {
"size";
struct Size {
size: u64,
-
#[serde(with = "Ordering")]
+
#[serde(with = "Ordering", default = "Ordering::default")]
ordering: std::cmp::Ordering,
};
(self, path) -> {
+12 -2
docs/ptsd.json.5.scd
···
Match name of the file against pattern. Available options (exclusive):
- *exact* - match name exactly
-
- *wildcard* - match name agains wildcard pattern
+
- *wildcard* - match name against wildcard pattern
- *regex* - match name against regular expression
*file_type*
···
return if subject of the test point to file of that type
*content_type*
-
Match agains content type.
+
Match against content type.
Options:
···
range 0..255 that describe magic bytes that will be read from the file
and matched. Optionally there can be also used option *offset* that
describes offset from the beginning of the file for the pattern.
+
+
*size*
+
Match against file size.
+
+
Options:
+
+
- *size* - value which will be compared with the file size
+
- *ordering* - one of *grater*, *equal*, *less* which determines what
+
comparison operator will be used.
+
There are also meta filters: