Skip to content

Commit 68f5887

Browse files
authoredAug 4, 2023
fix: remove duplicated name option in nargo new (#2183)
1 parent afc473d commit 68f5887

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed
 

‎crates/nargo_cli/src/cli/new_cmd.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use crate::errors::CliError;
22

3-
use super::{
4-
init_cmd::{initialize_project, InitCommand},
5-
NargoConfig,
6-
};
3+
use super::{init_cmd::initialize_project, NargoConfig};
74
use acvm::Backend;
85
use clap::Args;
96
use nargo::package::PackageType;
@@ -19,8 +16,13 @@ pub(crate) struct NewCommand {
1916
#[clap(long)]
2017
name: Option<String>,
2118

22-
#[clap(flatten)]
23-
init_config: InitCommand,
19+
/// Use a library template
20+
#[arg(long, conflicts_with = "bin")]
21+
pub(crate) lib: bool,
22+
23+
/// Use a binary template [default]
24+
#[arg(long, conflicts_with = "lib")]
25+
pub(crate) bin: bool,
2426
}
2527

2628
pub(crate) fn run<B: Backend>(
@@ -37,8 +39,7 @@ pub(crate) fn run<B: Backend>(
3739

3840
let package_name =
3941
args.name.unwrap_or_else(|| args.path.file_name().unwrap().to_str().unwrap().to_owned());
40-
let package_type =
41-
if args.init_config.lib { PackageType::Library } else { PackageType::Binary };
42+
let package_type = if args.lib { PackageType::Library } else { PackageType::Binary };
4243
initialize_project(package_dir, &package_name, package_type);
4344
Ok(())
4445
}

0 commit comments

Comments
 (0)
Please sign in to comment.