Correct reporting of permission errors on external subcommands

pmeunier
Aug 4, 2021, 1:26 PM
NIDZT2SQUZHH4YZWNQLSJYRHZPGT2EAGHHJHGZF2XYEFUL3N3YIQC

Dependencies

  • [2] JN34NIMJ More specific error for unrecognized subcommands
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • replacement in pijul/src/main.rs at line 220
    [2.257][2.257:499]()
    if err.kind() == std::io::ErrorKind::NotFound {
    writeln!(std::io::stderr(), "No such subcommand: {:?}", cmd).unwrap_or(());
    } else {
    writeln!(std::io::stderr(), "Error while running {:?}: {}", cmd, err).unwrap_or(());
    [2.257]
    [2.499]
    match err.kind() {
    std::io::ErrorKind::NotFound | std::io::ErrorKind::PermissionDenied => {
    writeln!(std::io::stderr(), "No such subcommand: {:?}", cmd).unwrap_or(())
    }
    _ => writeln!(std::io::stderr(), "Error while running {:?}: {}", cmd, err).unwrap_or(()),