Skip to content

how to get exit code from cmd_run #277

Description

@aalmkainzi

is there a way to do it? cmd_run returns bool (true for zero error code, false for non-zero). But I want the actual exit code number.

Maybe cmd_run should return int instead of bool? that would be a breaking change, but maybe it makes sense.

The other way to do it is via a pointer in the Opt.

e.g.

int exit_code;
cmd_run(&cmd, .exit_code = &exit_code);

and cmd_run would assign the exit code to the pointee.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions