Add --include-dependencies to 'aiken docs'

Fixes #867.
This commit is contained in:
KtorZ
2024-03-09 22:35:38 +01:00
parent 37627e3527
commit 80a9393db7
4 changed files with 23 additions and 5 deletions

View File

@@ -15,6 +15,10 @@ pub struct Args {
#[clap(short, long)]
watch: bool,
/// When enabled, also generate documentation from dependencies.
#[clap(long)]
include_dependencies: bool,
/// Output directory for the documentation
#[clap(short = 'o', long)]
destination: Option<PathBuf>,
@@ -26,14 +30,17 @@ pub fn exec(
deny,
watch,
destination,
include_dependencies,
}: Args,
) -> miette::Result<()> {
let result = if watch {
watch_project(directory.as_deref(), watch::default_filter, 500, |p| {
p.docs(destination.clone())
p.docs(destination.clone(), include_dependencies)
})
} else {
with_project(directory.as_deref(), deny, |p| p.docs(destination.clone()))
with_project(directory.as_deref(), deny, |p| {
p.docs(destination.clone(), include_dependencies)
})
};
result.map_err(|_| process::exit(1))