Use space-separated recipe paths in --choose
(#2115)
This commit is contained in:
parent
f5bb82dea3
commit
d2b10e04d3
@ -7,6 +7,13 @@ impl<'src> Namepath<'src> {
|
|||||||
pub(crate) fn join(&self, name: Name<'src>) -> Self {
|
pub(crate) fn join(&self, name: Name<'src>) -> Self {
|
||||||
Self(self.0.iter().copied().chain(iter::once(name)).collect())
|
Self(self.0.iter().copied().chain(iter::once(name)).collect())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn spaced(&self) -> ModulePath {
|
||||||
|
ModulePath {
|
||||||
|
path: self.0.iter().map(|name| name.lexeme().into()).collect(),
|
||||||
|
spaced: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'src> Display for Namepath<'src> {
|
impl<'src> Display for Namepath<'src> {
|
||||||
|
@ -261,14 +261,15 @@ impl Subcommand {
|
|||||||
};
|
};
|
||||||
|
|
||||||
for recipe in recipes {
|
for recipe in recipes {
|
||||||
if let Err(io_error) = child
|
writeln!(
|
||||||
.stdin
|
child.stdin.as_mut().unwrap(),
|
||||||
.as_mut()
|
"{}",
|
||||||
.expect("Child was created with piped stdio")
|
recipe.namepath.spaced()
|
||||||
.write_all(format!("{}\n", recipe.namepath).as_bytes())
|
)
|
||||||
{
|
.map_err(|io_error| Error::ChooserWrite {
|
||||||
return Err(Error::ChooserWrite { io_error, chooser });
|
io_error,
|
||||||
}
|
chooser: chooser.clone(),
|
||||||
|
})?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let output = match child.wait_with_output() {
|
let output = match child.wait_with_output() {
|
||||||
|
Loading…
Reference in New Issue
Block a user