Skip to content

Commit

Permalink
Release v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mfederczuk committed Apr 13, 2020
2 parents 88e365a + 8a376ec commit 37d1f88
Show file tree
Hide file tree
Showing 11 changed files with 1,676 additions and 61 deletions.
40 changes: 31 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,49 @@
<!-- markdownlint-disable MD024 MD007 -->
<!-- markdownlint-disable MD024 MD007 MD033 -->

# Changelog #

All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.0] - 2019-05-06 ##

### Added ###

* `commoncodes.h` C header file
* **See Also** page section with GitHub repo link

### Changed ###

* Status 100 & 124: Tweaked description a bit
* Inserted status "_option_: invalid option" between status "too many arguments" and "_argument_: invalid argument"
* Status "too many arguments" stays code 4
* Status "_option_: invalid option" is now 5
* Status "_argument_: invalid argument" is now 6
* Inserted status "argument #_n_: may not be empty/blank" between status "_argument_: invalid argument" and "_argument_: not a number/integer"
* Status "_argument_: invalid argument" is now code 6
* Status "argument #_n_: may not be empty/blank" is now code 7
* Status "_argument_: not a number/integer" is now code 8
* Moved statuses 21 - 26 one code up
e.g.: 21 → 22, and 26 → 27

[0.3.0]: https://speziil.github.io/commoncodes/v/0.2.0...0.3.0.html

## [0.2.0] - 2019-05-05 ##

### Added ###

* Other Errors
* 21: network error
* 22: no network connection
* 23: connection timed out
* 30: stack overflow error
* Status 21: network error
* Status 22: no network connection
* Status 23: connection timed out
* Status 30: stack overflow error

### Changed ###

* Other Errors
* 29: not enough memory -> not enough [heap ]memory
* Status 29: Tweaked message a bit
* "not enough memory" → "not enough <b>[</b>heap <b>]</b>memory"

[0.2.0]: https://speziil.github.io/commoncodes/v/0.2.0.html
[0.2.0]: https://speziil.github.io/commoncodes/v/0.1.0...0.2.0.html

## [0.1.0] - 2019-05-03 ##

Expand Down
39 changes: 26 additions & 13 deletions commoncodes.7
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.\}
..

.TH commoncodes 7 "0.2.0" "May 05, 2019" "CommonCodes man page"
.TH commoncodes 7 "0.3.0" "May 06, 2019" "CommonCodes man page"
.SH NAME
CommonCodes \- Standardized list of commonly used exit statuses

Expand Down Expand Up @@ -109,23 +109,33 @@ program.
Too many arguments have been passed down to the program or to an option of the
program.
.IP 5
.bir "" "option" ": invalid option"
.br
The entered option is not specified in the program.
.IP 6
.bir "[" "option" ": " "]" "argument" ": invalid argument" "[" "" ": " "" "info" "" "]"
.br
The argument is invalid and cannot be used.
.IP 6
.IP 7
.rbi "argument #" "" "n" ": may not be " "(" "" "empty" "|" "" "blank" ")"
.br
Program can not work with empty or blank argument.
.br
"Blank" means none or only whitespace characters.
.IP 8
.bir "[" "option" ": " "]" "argument" ": not a" "[" "" "n" "]" "" " " "(" "" "number" "|" "" "integer" ")"
.br
The argument is not a valid number or is not a valid integer.
.br
If a valid decimal number has been entered and this exit status is returned then
you must convert the decimal number into an integer.
.br
.IP 7
.IP 9
.bir "[" "option" ": " "]" "argument" ": does not match: " "" "pattern"
.br
The argument does not match the pattern provided. The pattern can be glob, regex
or any other pattern matching system.
.IP "8 - 15"
.IP "10 - 15"
.B "(custom usage errors)"
.br
Usage errors defined by the developer of the program. These should always be
Expand All @@ -150,31 +160,31 @@ The item in question is of the wrong type.
.IP 20
?
.IP 21
?
.IP 22
.rbi "network error" "[" "" ": " "" "info" "" "]"
.br
A general network error occurred.
.IP 22
.IP 23
no network connection
.br
No network connection is established.
.IP 23
.IP 24
connection timed out
.br
A network request took too long and timed out.
.IP 24
.IP 25
.rbi "arithmetic error" "[" "" ": " "" "info" "" "]"
.br
A general arithmetic error occured.
.IP 25
.IP 26
divided by 0 error
.br
A division by 0 was tried to be executed and there was no fallback option.
.IP 26
.IP 27
.bir "(" "" "overflow" "|" "" "underflow" ")" "" " error"
.br
An overflow or underflow happened and it has critical effects on the program.
.IP 27
?
.IP 28
.rbi "memory error" "[" "" ": " "" "info" "" "]"
.br
Expand Down Expand Up @@ -273,7 +283,7 @@ should always be documented.
General internal fault.
.br
An internal fault happens when preconditions prevent the program to advance to a
stage where user input is awaited.
next stage of execution.
.IP "101 - 123"
.B (custom internal faults)
.br
Expand All @@ -282,7 +292,7 @@ documented.
.IP 124
.rbi "script was " "[" "" "not " "]" "" "called interactively"
.br
The script can either only be executed interactively (using command "." or
The shell script can either only be executed interactively (using command "." or
"source"), or not interactively (executing via "./").
.IP 125
unknown error
Expand All @@ -298,5 +308,8 @@ systems and code 64 when distributing for
.B BSD
systems.

.SH SEE ALSO
<https://github.com/SpEZiiL/commoncodes>

.SH AUTHOR
Michael Federczuk <federczuk.michael@hotmail.com>
81 changes: 81 additions & 0 deletions commoncodes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* CommonCodes C header file - Standardized list of commonly used exit statuses.
* Copyright (C) 2019 Michael Federczuk
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef _COMMONCODES_H
#define _COMMONCODES_H

/* See <https://speziil.github.io/commoncodes/v/0.3.0.html> for more info */

#define CC_SUCCESS 0 /* success */
#define CC_GEN_ERR 1 /* generic error */
#define CC_GEN_USAGE_ERR 2 /* generic usage error */
#define CC_MISS_ARGS 3 /* missing arguments */
#define CC_TOO_MANY_ARGS 4 /* too many arguments */
#define CC_INV_OPT 5 /* invalid option */
#define CC_INV_ARG 6 /* invalid argument */
#define CC_NO_EMPTY_ARG 7 /* may not be empty */
#define CC_NO_BLANK_ARG 7 /* may not be blank */
#define CC_NO_NUM 8 /* not a number */
#define CC_NO_INT 8 /* not an integer */
#define CC_NO_MATCH 9 /* does not match */
/* 10 - 15: custom usage errors */
#define CC_NO_SUCH_ITEMTYPE 16 /* no such itemtype */
#define CC_NOT_A_ITEMTYPE 17 /* not a itemtype */
#define CC_NOT_AN_ITEMTYPE 17 /* not an itemtype */
/* #define CC_ 18 */
/* #define CC_ 19 */
/* #define CC_ 20 */
/* #define CC_ 21 */
#define CC_NET_ERR 22 /* network error */
#define CC_NO_NET_CON 23 /* no network connection */
#define CC_CON_TIMED_OUT 24 /* connection timed out */
#define CC_ARIT_ERR 25 /* arithmetic error */
#define CC_DIV_BY_0_ERR 26 /* divied by 0 error */
#define CC_OFLOW_ERR 27 /* overflow error */
#define CC_UFLOW_ERR 27 /* underflow error */
#define CC_MEM_ERR 28 /* memory error */
#define CC_NO_MEM 29 /* not enough memory */
#define CC_NO_HMEM 29 /* not enough heap memory */
#define CC_STACK_OFLOW_ERR 30 /* stack overflow error */
#define CC_EMERG_STOP 31 /* emergency stop */
/* 32 - 63: custom errors */
/* BSD errors */
#define CC_USAGE 64 /* command line usage error */
#define CC_DATAERR 65 /* data format error */
#define CC_NOINPUT 66 /* cannot open input */
#define CC_NOUSER 67 /* addresse unknown */
#define CC_NOHOST 68 /* host name unknown */
#define CC_UNAVAILABLE 69 /* service unavailable */
#define CC_SOFTWARE 70 /* internal software error */
#define CC_OSERR 71 /* system error (e.g., can't fork) */
#define CC_OSFILE 72 /* critical OS file missing */
#define CC_CANTCREAT 73 /* can't create (user) output file */
#define CC_IOERR 74 /* inout/output error */
#define CC_TEMPFAIL 75 /* temp failure; user is invited to retry */
#define CC_PROTOCOL 76 /* remote error in protocol */
#define CC_NOPERM 77 /* permission denied */
#define CC_CONFIG 78 /* configuration error */
/* BSD errors end */
/* 79 - 99: custom configuration errors */
#define CC_GEN_INTERN_FAULT 100 /* generic internal fault */
/* 101 - 123: custom internal faults */
#define CC_SCRIPT_CALLED_INTERACTIVELY 124 /* script was called interactively */
#define CC_SCRIPT_NOT_CALLED_INTERACTIVELY 124 /* script was not called interactively */
#define CC_UNKNOWN_ERR 125 /* unknown error */

#endif /* _COMMONCODES_H */
20 changes: 20 additions & 0 deletions docs/diff.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.diff_addition {
color: #00EF00;
background-color: rgba(0, 255, 0, 0.125);
}
.diff_addition::selection, .diff_addition *::selection { background-color: #00DF00; }
.diff_addition::-moz-selection, .diff_addition *::-moz-selection { background-color: #00DF00; }

.diff_deletion {
color: #EF0000;
background-color: rgba(255, 0, 0, 0.125);
}
.diff_deletion::selection, .diff_deletion *::selection { background-color: #DF0000; }
.diff_deletion::-moz-selection, .diff_deletion *::-moz-selection { background-color: #DF0000; }

.diff_change {
color: #EFEF00;
background-color: rgba(255, 255, 0, 0.125);
}
.diff_change::selection, .diff_change *::selection { background-color: #DFDF00; }
.diff_change::-moz-selection, .diff_change *::-moz-selection { background-color: #DFDF00; }
Loading

0 comments on commit 37d1f88

Please sign in to comment.