[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sed suggestion: standarize exit code values
From: |
Jim Meyering |
Subject: |
Re: sed suggestion: standarize exit code values |
Date: |
Fri, 21 Oct 2016 08:54:44 -0700 |
On Thu, Oct 20, 2016 at 7:11 PM, Assaf Gordon <address@hidden> wrote:
> I'd like to suggest the following minor adjustment: use well defined exit
> code, document them, and use constants in the code instead of hard-coded
> values.
Hi Assaf,
Thank you. I like the idea of switching from literals to symbolic names.
However, the name "EXIT_BAD_COUNT" is not evocative of "failed to open
one or more input file".
Maybe something like "EXIT_BAD_INPUT" or the longer "EXIT_INPUT_OPEN_FAIL"?
>From your commit log and patch:
-----------
sed: standarize exit code values
Use exit-code constants, and document them.
Keep previous undocumented behaviour of code 4=panic, 2=bad input files.
Change syntax-errors/program-errors to value 3 (previously: 1).
Add "Exit Status" section in manual.
+ sed now uses the following exit codes:
+ 0 = success
+ 2 = one or more input files could not be opened
+ 3 = syntax error in sed program
+ 4 = panic (I/O error or internal error)
----------
Why do you want to make that semantic change? exit 1 -> exit 3?
I would be inclined to make the semantic change in a separate diff.