Skip to content

Conversation

@rpgoldman
Copy link

When the -x flag is supplied, Validate will set its exit status to 1 if validation fails, enabling it to be used in a standard Unix pipeline.

@rpgoldman rpgoldman marked this pull request as draft March 12, 2025 17:46
When the `-x` flag is supplied, `Validate` will set its exit status to
1 if validation fails, enabling it to be used in a standard Unix
pipeline.
If there is not at least a domain supplied, print the usage (as
before), and set the exit status to 1.

Possibly this should be a distinct value, instead of just 1.
As for Validate, sets exit status non-zero on failure.
@rpgoldman rpgoldman marked this pull request as ready for review April 8, 2025 16:03
@rpgoldman
Copy link
Author

This merge request is, I think, good to go. Per your suggestion on #20 , I have added a command-line switch to Validate, -x, that will set the exit status on failures.

In the process, I discovered that there were failures that would be caught in parsing, but not caught in validation, so I added the -x argument to Parser, as well as Validate.

This has been very handy for putting VAL into test suites for planning domains, etc.

@DerekLong101
Copy link
Contributor

DerekLong101 commented Apr 10, 2025 via email

@rpgoldman
Copy link
Author

@DerekLong101 Sounds good! When you get a chance, it would be good to review this to make sure that I found all the places where Validate and Parser can exit, and made sure to set the exit status appropriately.

Possibly I should distinguish between error exit (maybe status 2) and validation failure (1).

Finally, I'm not sure I know what the various exits with -1 mean.

Anyway, when you get a chance, we can merge this.

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