Skip to content

Commit

Permalink
add the --filter argument
Browse files Browse the repository at this point in the history
Fix #41
  • Loading branch information
Canop committed Mar 3, 2022
1 parent 09b2d9d commit e51128a
Show file tree
Hide file tree
Showing 9 changed files with 497 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### next
- 'unreachable' information available in JSON and in the table (in the 'use' column). This mostly concerns disconnected remote filesystems.
- `--filter` argument to filter the displayed filesystems - Fix #41

<a name="v2.3.1"></a>
### v2.3.1 - 2022/03/01
Expand Down
9 changes: 8 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lfs"
version = "2.3.2-dev"
version = "2.4.0-dev"
authors = ["dystroy <denys.seguret@gmail.com>"]
edition = "2021"
keywords = ["linux", "filesystem", "fs"]
Expand All @@ -13,6 +13,7 @@ rust-version = "1.56"

[dependencies]
argh = "0.1.7"
bet = "1.0.0"
crossterm = "0.22.1"
file-size = "1.0.3"
lfs-core = "0.10.2"
Expand Down
68 changes: 68 additions & 0 deletions bacon.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# This is a configuration file for the bacon tool
# More info at https://github.com/Canop/bacon

default_job = "check"

[jobs]

[jobs.check]
command = ["cargo", "check", "--color", "always"]
need_stdout = false

[jobs.check-all]
command = ["cargo", "check", "--all-targets", "--color", "always"]
need_stdout = false
watch = ["tests", "benches", "examples"]

[jobs.clippy]
command = [
"cargo", "clippy",
"--color", "always",
"--",
"-A", "clippy::collapsible_else_if",
"-A", "clippy::collapsible_if",
"-A", "clippy::enum_variant_names",
"-A", "clippy::match_like_matches_macro",
]
need_stdout = false

[jobs.clippy-all]
command = ["cargo", "clippy", "--all-targets", "--color", "always"]
need_stdout = false
watch = ["tests", "benches", "examples"]

[jobs.test]
command = ["cargo", "test", "--color", "always"]
need_stdout = true
watch = ["tests"]

[jobs.doc]
command = ["cargo", "doc", "--color", "always", "--no-deps"]
need_stdout = false

# if the doc compiles, then it opens in your browser and bacon switches
# to the previous job
[jobs.doc-open]
command = ["cargo", "doc", "--color", "always", "--no-deps", "--open"]
need_stdout = false
on_success = "back" # so that we don't open the browser at each change

# You can run your application and have the result displayed in bacon,
# *if* it makes sense for this crate. You can run an example the same
# way. Don't forget the `--color always` part or the errors won't be
# properly parsed.
[jobs.run]
command = ["cargo", "run", "--color", "always"]
need_stdout = true

# You may define here keybindings that would be specific to
# a project, for example a shortcut to launch a specific job.
# Shortcuts to internal functions (scrolling, toggling, etc.)
# should go in your personal prefs.toml file instead.
[keybindings]
a = "job:check-all"
i = "job:initial"
c = "job:clippy"
d = "job:doc-open"
t = "job:test"
r = "job:run"
5 changes: 5 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use {
crate::{
cols::Cols,
filter::Filter,
units::Units,
sorting::Sorting,
},
Expand Down Expand Up @@ -34,6 +35,10 @@ pub struct Args {
#[argh(option, default = "Default::default()", short = 'c')]
pub cols: Cols,

/// filter, eg `-f '(size<35G | remote=false) & type=xfs'`
#[argh(option, default = "Default::default()", short = 'f')]
pub filter: Filter,

/// sort, eg `-s inodes` or `-s size-asc`
#[argh(option, default = "Default::default()", short = 's')]
pub sort: Sorting,
Expand Down
Loading

0 comments on commit e51128a

Please sign in to comment.