diff --git a/CHANGELOG.md b/CHANGELOG.md index e3f6e7f607..e1819ebdb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * fix: change error returned when subtracting two `MaybeRelocatable`s to better reflect the cause [#1271](https://github.com/lambdaclass/cairo-rs/pull/1271) +* fix: CLI error message when using --help [#1270](https://github.com/lambdaclass/cairo-rs/pull/1270) + #### [0.6.0] - 2023-6-18 * fix: `dibit` hint no longer fails when called with an `m` of zero [#1247](https://github.com/lambdaclass/cairo-rs/pull/1247) diff --git a/cairo-vm-cli/src/main.rs b/cairo-vm-cli/src/main.rs index ac816e9fbc..a42c95eac4 100644 --- a/cairo-vm-cli/src/main.rs +++ b/cairo-vm-cli/src/main.rs @@ -164,7 +164,13 @@ fn run(args: impl Iterator) -> Result<(), Error> { } fn main() -> Result<(), Error> { - run(std::env::args()) + match run(std::env::args()) { + Ok(()) => Ok(()), + Err(Error::Cli(_)) => { + Ok(()) // Exit with code 0 to avoid printing CLI error message + } + Err(error) => Err(error), + } } #[cfg(test)] @@ -260,7 +266,7 @@ mod tests { //to fool Codecov. #[test] fn test_main() { - assert!(main().is_err()); + assert!(main().is_ok()); } #[test]