forc/cli/commands/
clean.rs

1use crate::ops::forc_clean;
2use clap::Parser;
3use forc_util::ForcResult;
4
5forc_util::cli_examples! {
6    crate::cli::Opt {
7        [Clean project => "forc clean"]
8        [Clean project with a custom path => "forc clean --path <PATH>"]
9    }
10}
11
12/// Removes the default forc compiler output artifact directory, i.e. `<project-name>/out`.
13#[derive(Debug, Parser)]
14#[clap(bin_name = "forc clean", version, after_help = help())]
15pub struct Command {
16    /// Path to the project, if not specified, current working directory will be used.
17    #[clap(short, long)]
18    pub path: Option<String>,
19}
20
21pub fn exec(command: Command) -> ForcResult<()> {
22    forc_clean::clean(command)?;
23    Ok(())
24}