summaryrefslogtreecommitdiff
path: root/src/commands/list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/list.rs')
-rw-r--r--src/commands/list.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/commands/list.rs b/src/commands/list.rs
index 0ed6be05..2cb93962 100644
--- a/src/commands/list.rs
+++ b/src/commands/list.rs
@@ -21,7 +21,18 @@ fn list_keys(fs: &Fs, opt: Cli) -> anyhow::Result<()> {
break;
}
+ match opt.bkey_type {
+ Some(ty) => {
+ if k.k.type_ != ty as u8 {
+ iter.advance();
+ continue;
+ }
+ }
+ _ => {}
+ };
+
println!("{}", k.to_text(fs));
+
iter.advance();
}
@@ -97,6 +108,10 @@ pub struct Cli {
#[arg(short, long, default_value_t=bcachefs::btree_id::BTREE_ID_extents)]
btree: bcachefs::btree_id,
+ /// Bkey type to list
+ #[arg(short='k', long)]
+ bkey_type: Option<bcachefs::bch_bkey_type>,
+
/// Btree depth to descend to (0 == leaves)
#[arg(short, long, default_value_t=0)]
level: u32,