Closed Cj-bc closed 6 years ago
Perhaps the exit codes could follow a similar convention to
color.sh
?
I was not sure what prefix should I use... Is it like below?:
Util.exit.OK
( This is better?: util.exit.ok
)
the last comment about the "maximum listed value". What does that mean?
Sorry, that's kind of my mistake.
It was in sysexits.h
. So I left it.
Actually, I also don't know what that mean...(perhaps, for reference?)
It seems to be better to remove that one
Let's go with something along the lines of: Util.ExitCode.OK
Alternatively, if we want to keep simple vars, we can also do underscores instead of dots.
Thanks.
As there're not only return
but also @return:var
,
I want to take simple vars so that we can use with both return
s.
(I'm using both of them. Actually, I'm not sure how to use them properly.)
And, if we do this, we can use those exit code numbers in other place, for example, in test code.
So... it'll like this?:
UTIL_EXCODE_OK
usage example:
return $UTIL_EXCODE_OK
@return:val $UTIL_EXCODE_OK
Let's go with upper camelCase, namespaced by underscores: $Util_ExitCode_OK
ok, I'll make change to that style ;)
I'm wondering which is better to use upper camelcase for the codename too( ex: Util_ExitCode_Ok
, Util_ExitCode_Dataerror
) or not (ex: Util_ExitCode_OK
, Util_ExitCode_DATAERROR
)
I think 2nd one (don't use camelcase) is better, because it is easier to know that it is const.
But how do you think?
Yes, I agree! Let's go with uppercase const part.
Thank you!
In some shellscript coding guide, I found that we should follow
/usr/include/sysexits.h
to define exit code. So I added list of those exit codes as variables.Those values are come from /usr/include/sysexits.h