client/get_closure: Add --include-outputs

This commit is contained in:
Zhaofeng Li 2023-01-14 23:55:10 -07:00
parent 8fc6b3935d
commit 332ac5051c

View file

@ -12,6 +12,10 @@ use attic::nix_store::NixStore;
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
pub struct GetClosure { pub struct GetClosure {
store_path: PathBuf, store_path: PathBuf,
/// For derivations, include their outputs.
#[clap(long)]
include_outputs: bool,
} }
pub async fn run(opts: Opts) -> Result<()> { pub async fn run(opts: Opts) -> Result<()> {
@ -20,7 +24,7 @@ pub async fn run(opts: Opts) -> Result<()> {
let store = NixStore::connect()?; let store = NixStore::connect()?;
let store_path = store.follow_store_path(&sub.store_path)?; let store_path = store.follow_store_path(&sub.store_path)?;
let closure = store let closure = store
.compute_fs_closure(store_path, false, false, false) .compute_fs_closure(store_path, false, sub.include_outputs, false)
.await?; .await?;
for path in &closure { for path in &closure {