Skip to content

fix: assign success status when displaying help usage via -h or -help - #14

Open
KristijanZic wants to merge 1 commit into
objective-see:masterfrom
KristijanZic:master
Open

fix: assign success status when displaying help usage via -h or -help#14
KristijanZic wants to merge 1 commit into
objective-see:masterfrom
KristijanZic:master

Conversation

@KristijanZic

Copy link
Copy Markdown

Added success status assignment before exiting help usage.

In environments with set -e -o pipefail returning a non-zero exit code like -1 or (255 when -1 gets wrapped around to the maximum unsigned 8-bit value) results in help tests invocations failing like in this one:

set -e -o pipefail
filemonitor -h | grep -F "FileMonitor"

the issue is, some environments like Nix test have set -e -o pipefail set by default like here:

    tests = {
      help = testers.runCommand {
        name = "filemonitor-help-test";
        buildInputs = [ finalAttrs.finalPackage ];
        script = ''
          filemonitor -h | grep -F "FileMonitor (v${finalAttrs.version})"
          touch $out
        '';
      };
    };

And while one can work around this issue, a proper fix would be much better.

Added success status assignment before exiting help usage.
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.

1 participant