diff options
Diffstat (limited to 'src/commands/list.rs')
-rw-r--r-- | src/commands/list.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/commands/list.rs b/src/commands/list.rs index 0ed6be05..fd61a516 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -21,6 +21,13 @@ fn list_keys(fs: &Fs, opt: Cli) -> anyhow::Result<()> { break; } + if let Some(ty) = opt.bkey_type { + if k.k.type_ != ty as u8 { + iter.advance(); + continue; + } + } + println!("{}", k.to_text(fs)); iter.advance(); } @@ -97,6 +104,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, |