Skip to content

Commit 1aa1bc2

Browse files
committed
require --name for update
1 parent dc24680 commit 1aa1bc2

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/main.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ struct CreateArgs {
3333

3434
#[derive(Parser)]
3535
struct UpdateArgs {
36+
#[clap(long, required = true)]
37+
name: String,
3638
#[clap(long, required = false, default_value = "python3.10")]
3739
preset: String,
3840
}
@@ -58,9 +60,14 @@ fn main() {
5860
}
5961
}
6062
Cli::Update(args) => {
61-
println!("Updating project with preset: {:?}", args.preset);
62-
check_pyver(&args.preset);
63-
setup_preset(&args.preset, "".to_string(), false);
63+
println!("Updating project with name: {}", args.name);
64+
println!("Using preset: {:?} ", args.preset);
65+
if args.preset.starts_with("python") {
66+
check_pyver(&args.preset);
67+
setup_preset(&args.preset, args.name, false);
68+
} else {
69+
eprintln!("Preset: {:?} not supported", args.preset);
70+
}
6471
}
6572
}
6673
}

templates/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# File set up by cpa: https://github.com/ysawa0/create-python-app for more info.
12
[tool.poetry]
23
name = "{{ name }}"
34
version = "0.0.1"

0 commit comments

Comments
 (0)