cmp::parse_params exits the process on --help instead of returning

Open
#220 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
cli, testing

Research direction

Start at the cmp::parse_params entry point and inspect how the --help path is handled, then review the fuzz-target call that exposed the process exit. Reproduce the CI failure or run the relevant fuzz target. Done means callers can handle --help without the process being terminated.

Written by the indexing model from the issue text.

Description

When --help is passed to cmp::parse_params, it calls process::exit(0) which kills the whole process. Found this while working on the fuzz targets, the fuzzer kept crashing because of it.
Workaround is to filter --help before calling parse_params, but ideally the function should just return the help text instead of exiting.

Not sure if this is worth a bigger refactor or just leaving the workaround in place, open to suggestions.
Example CI failure: https://github.com/uutils/diffutils/actions/runs/24710862259

Dominant language
Rust
Stars
276
Forks
39
Avg merge
3h 27m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/diffutils

All issues in uutils/diffutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.