Skip to content

Commit

Permalink
Put exit status definitions back into updater.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
aartoni committed Nov 25, 2024
1 parent 058838d commit 1c58991
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
run: ln -sf /usr/bin/${{ matrix.shell }} /bin/sh
- name: Check exit status definitions
run: |
. ./lib.sh
. ./updater.sh 2>/dev/null
while IFS='=' read -r name code; do
# "When reporting the exit status with the special parameter '?',
Expand Down
34 changes: 0 additions & 34 deletions lib.sh

This file was deleted.

33 changes: 32 additions & 1 deletion updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,38 @@
#### and duplicated only to maintain the same file count as before. ####
###############################################################################

. ./lib.sh
# https://stackoverflow.com/q/1101957
exit_status_definitions() {
cut -d'#' -f1 <<'EOF'
_EX_OK=0 # Successful exit status.
_EX_FAIL=1 # Failed exit status.
_EX_USAGE=2 # Command line usage error.
_EX__BASE=64 # Base value for error messages.
_EX_DATAERR=65 # Data format error.
_EX_NOINPUT=66 # Cannot open input.
_EX_NOUSER=67 # Addressee unknown.
_EX_NOHOST=68 # Host name unknown.
_EX_UNAVAILABLE=69 # Service unavailable.
_EX_SOFTWARE=70 # Internal software error.
_EX_OSERR=71 # System error (e.g., can't fork).
_EX_OSFILE=72 # Critical OS file missing.
_EX_CANTCREAT=73 # Can't create (user) output file.
_EX_IOERR=74 # Input/output error.
_EX_TEMPFAIL=75 # Temp failure; user is invited to retry.
_EX_PROTOCOL=76 # Remote error in protocol.
_EX_NOPERM=77 # Permission denied.
_EX_CONFIG=78 # Configuration error.
_EX_NOEXEC=126 # A file to be executed was found, but it was not an executable utility.
_EX_CNF=127 # A utility to be executed was not found.
_EX_SIGHUP=129 # A command was interrupted by SIGHUP (1).
_EX_SIGINT=130 # A command was interrupted by SIGINT (2).
_EX_SIGQUIT=131 # A command was interrupted by SIGQUIT (3).
_EX_SIGABRT=134 # A command was interrupted by SIGABRT (6).
_EX_SIGKILL=137 # A command was interrupted by SIGKILL (9).
_EX_SIGALRM=142 # A command was interrupted by SIGALRM (14).
_EX_SIGTERM=143 # A command was interrupted by SIGTERM (15).
EOF
}

is_option_present() { # arg: name
[ "$1" = true ] || {
Expand Down

0 comments on commit 1c58991

Please sign in to comment.