Closed fow0ryl closed 2 years ago
Or maybe separate options like --type ext4,xfs
or --no-type tmpfs
or --min-use 90%
or --disk lvm,ssd
.
Or maybe something like --filter 'type=ext4,xfs and disk!=ssd and use>90'
If I do the filtering, it would probably like those examples:
lfs --filter 'type=ext4'
lfs --filter 'type=ext4&disk=hdd'
lfs --filter 'type=ext4 & (use_percent > 85 | free < 1234567 )'
The structure of the code makes that easy enough and I've already the libraries to to this kind of things (for example bet) which I do in other Rust programs.
Great.
I don't care about the syntax. I was only interested in functionality and of course it should preferably be able to be seamlessly integrated into your program code. At least your suggestion offers many more then I need... But surely there are people around who are waiting for ;)
It works:
=
is less strict than ==
:
I'll have to write the relevant web documentation before I release.
Tests & feedback would be appreciated.
Works great.
Nice: lfs -a
show everything including automounter mountpoint, cgroup entries, etc. But lfs -a -f 'use>=0'
restricts the output to mounts which have a real size.
Also nice: the possibility of matching substrings ("filesystem=sda"). Although, according to common syntaxes elsewhere (e.g. bash or perl), I would prefer to use =~
here. In normal people's understanding, "=" means equality, but "/dev/sda2" is in no way equal to "sda". And also non-programmers would understand "=~" as "similar" or "roughly equal".
And one general thing: I really appreciate how quickly you respond to all the people around here and how things move forward and forward! Thank you! Keep up the good work!
@DerPoet The main constraint I had given myself for column operators was to have the same whatever the column type. Having a ~=
operator would mean it would do something for integers or float numbers too. And ~=
is also often used for regular expression based checks. This could come in the future so right now I didn't want to use that cartdridge.
BTW it's released in lfs 2.4.0
When using lfs on a server you will get a log list of devices. So I would be great to filter output in a "grep" like way.
i.e. find all rows containing "sdb" in any displayed column -f *,"sdb"
or find all rows containing "sdb" only in the devices column. -f devices,"sdb"