coreutils

General Software Utilities
git clone http://git.omkov.net/coreutils
Log | Tree | Refs | README | LICENCE | Download

AuthorJamozed <[email protected]>
Date2020-06-26 03:08:55
Commit16cc815fc5b9a6af78646d77deabf990501dd76a
Parent479626e6c53944067bec17c213f8df9cb1014bd1

false: Add POSIX false

Diffstat

M CMakeLists.txt | 1 +
M README.md | 1 +
A man/false.1 | 18 ++++++++++++++++++
A src/false.c | 20 ++++++++++++++++++++

4 files changed, 40 insertions, 0 deletions

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd96d19..987e23a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,4 +11,5 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ext)
 
 ADD_EXECUTABLE(cat      ${CMAKE_SOURCE_DIR}/src/cat.c)
+ADD_EXECUTABLE(false    ${CMAKE_SOURCE_DIR}/src/false.c)
 ADD_EXECUTABLE(true     ${CMAKE_SOURCE_DIR}/src/true.c)
diff --git a/README.md b/README.md
index 349c426..78fa518 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@ commonly found on UNIX-like systems.
 | Utility          | Description                              | Standard |
 | ---------------- | ---------------------------------------- | -------- |
 | cat              | Concatenate and print files              | POSIX    |
+| false            | Return false value                       | POSIX    |
 | true             | Return true value                        | POSIX    |
 
 ## Build Instructions
diff --git a/man/false.1 b/man/false.1
new file mode 100644
index 0000000..1325b3c
--- /dev/null
+++ b/man/false.1
@@ -0,0 +1,18 @@
+.TH FALSE 1 2020-06-26 "OMKOV coreutils" "General Commands Manual"
+.SH NAME
+false \(em return false value
+.SH SYNOPSYS
+.B false
+.SH DESCRIPTION
+Return a non-zero exit code.
+.SH STANDARDS
+The \fIfalse\fR utility is compliant with the IEEE Std 1003.2-1992 ("POSIX.2")
+specification.
+.SH SEE ALSO
+.I true
+.SH COPYRIGHT
+.nf
+Copyright (C) 2020, Jakob Wakeling
+All rights reserved.
+OMKOV Public Domain Licence (https://www.omkov.net/OLPD)
+.fi
diff --git a/src/false.c b/src/false.c
new file mode 100644
index 0000000..6a17bc8
--- /dev/null
+++ b/src/false.c
@@ -0,0 +1,20 @@
+// false.c, version 1.0.0
+// OMKOV coreutils implementation of POSIX false
+// Copyright (C) 2020, Jakob Wakeling
+// All rights reserved.
+
+/*
+OMKOV Public Domain Licence, version 1.0
+
+Permission is hereby granted to deal with this software and its associated
+documentation files without restriction.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT
+HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
+*/
+
+int main(void) { return 1; }