Handle more EPIPE situations
In order to be easier for scripts to use us, until we define a
proper CLI API for that, handle EPIPE situations on all the list
type subcommands as well as the show subcommands.
Fixes
@@ -49,25 +49,25 @@ pub fn main() -> Result<()> {
("default", Some(m)) => default_(cfg, m)?,
("toolchain", Some(c)) => match c.subcommand() {
("install", Some(m)) => update(cfg, m)?,
- ("list", Some(_)) => common::list_toolchains(cfg)?,
+ ("list", Some(_)) => handle_epipe(common::list_toolchains(cfg))?,
("link", Some(m)) => toolchain_link(cfg, m)?,
("uninstall", Some(m)) => toolchain_remove(cfg, m)?,
(_, _) => unreachable!(),
},
("target", Some(c)) => match c.subcommand() {
- ("list", Some(m)) => target_list(cfg, m)?,
+ ("list", Some(m)) => handle_epipe(target_list(cfg, m))?,
("add", Some(m)) => target_add(cfg, m)?,
("remove", Some(m)) => target_remove(cfg, m)?,
(_, _) => unreachable!(),
},
("component", Some(c)) => match c.subcommand() {
- ("list", Some(m)) => component_list(cfg, m)?,
+ ("list", Some(m)) => handle_epipe(component_list(cfg, m))?,
("add", Some(m)) => component_add(cfg, m)?,
("remove", Some(m)) => component_remove(cfg, m)?,
(_, _) => unreachable!(),
},
("override", Some(c)) => match c.subcommand() {
- ("list", Some(_)) => common::list_overrides(cfg)?,
+ ("list", Some(_)) => handle_epipe(common::list_overrides(cfg))?,
("set", Some(m)) => override_add(cfg, m)?,
("unset", Some(m)) => override_remove(cfg, m)?,
(_, _) => unreachable!(),
