@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user