Skip to content

Conversation

@cakebaker
Copy link
Contributor

@cakebaker cakebaker commented Mar 21, 2025

Currently, we require at least one program name and if none is provided, a clap error message is shown. This makes the following code snippet in uumain unreachable:

    if arg_program_name.is_none() {
        uucore::error::set_exit_code(1);
        return Ok(());
    };

This PR no longer requires a program name and thus makes the snippet above reachable. It also corresponds with the behavior of the original pidof, which doesn't show an error message if called without any args.

The PR also removes the #[cfg(target_os = "linux")] of the test as it is not necessary.

@Krysztal112233 Krysztal112233 merged commit d70f9a7 into uutils:main Mar 24, 2025
14 checks passed
@codecov
Copy link

codecov bot commented Mar 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (92d674b) to head (5ca17df).
Report is 8 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #359   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cakebaker cakebaker deleted the pidof_dont_require_program_name branch March 24, 2025 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants