Skip to content

Commit 7261f38

Browse files
committed
change setup subcommand to take a single path only
1 parent 5f778bb commit 7261f38

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/bootstrap/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ impl<'a> Builder<'a> {
824824
Subcommand::Install { ref paths } => (Kind::Install, &paths[..]),
825825
Subcommand::Run { ref paths } => (Kind::Run, &paths[..]),
826826
Subcommand::Format { .. } => (Kind::Format, &[][..]),
827-
Subcommand::Setup { ref paths } => (Kind::Setup, &paths[..]),
827+
Subcommand::Setup { ref path } => (Kind::Setup, if let Some(p) = path { std::slice::from_ref(p) } else { &[] }),
828828
Subcommand::Clean { .. } => {
829829
panic!()
830830
}

src/bootstrap/flags.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub enum Subcommand {
141141
paths: Vec<PathBuf>,
142142
},
143143
Setup {
144-
paths: Vec<PathBuf>,
144+
path: Option<PathBuf>,
145145
},
146146
}
147147

@@ -543,7 +543,7 @@ Arguments:
543543
Kind::Bench | Kind::Clean | Kind::Dist | Kind::Install => {}
544544
};
545545
// Get any optional paths which occur after the subcommand
546-
let paths = matches.free[1..].iter().map(|p| p.into()).collect::<Vec<PathBuf>>();
546+
let mut paths = matches.free[1..].iter().map(|p| p.into()).collect::<Vec<PathBuf>>();
547547

548548
let verbose = matches.opt_present("verbose");
549549

0 commit comments

Comments
 (0)