Skip to content

Commit

Permalink
Remove additional context from clap errors
Browse files Browse the repository at this point in the history
From the looks of it, clap reported errors are basically meant to stand
on their own. In our case, the additional "failed to parse program
arguments" context we add doesn't help at all and just causes the
resulting error report to look awkward:

  > failed to parse program arguments: error: unexpected argument '-a' found
  >
  > Usage: apcacli [OPTIONS] <COMMAND>
  >
  > For more information, try '--help'.

Omit this context for a slightly improved experience.
  • Loading branch information
d-e-s-o committed Dec 29, 2024
1 parent 95ae0aa commit c1fa008
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ async fn run() -> Result<()> {
print!("{}", err);
return Ok(())
},
_ => return Err(err).context("failed to parse program arguments"),
_ => return Err(err.into()),
},
};

Expand Down

0 comments on commit c1fa008

Please sign in to comment.