coreutils

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

AuthorJamozed <[email protected]>
Date2020-06-26 03:07:06
Commit479626e6c53944067bec17c213f8df9cb1014bd1
Parent34337b484531502b36c515dc1b305faf537906e1

true: Add POSIX true

Diffstat

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

4 files changed, 40 insertions, 0 deletions

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e47c176..dd96d19 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,3 +11,4 @@ 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(true     ${CMAKE_SOURCE_DIR}/src/true.c)
diff --git a/README.md b/README.md
index c35798f..349c426 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    |
+| true             | Return true value                        | POSIX    |
 
 ## Build Instructions
 
diff --git a/man/true.1 b/man/true.1
new file mode 100644
index 0000000..d261e40
--- /dev/null
+++ b/man/true.1
@@ -0,0 +1,18 @@
+.TH TRUE 1 2020-06-26 "OMKOV coreutils" "General Commands Manual"
+.SH NAME
+true \(em return true value
+.SH SYNOPSYS
+.B true
+.SH DESCRIPTION
+Return a zero exit code.
+.SH STANDARDS
+The \fItrue\fR utility is compliant with the IEEE Std 1003.2-1992 ("POSIX.2")
+specification.
+.SH SEE ALSO
+.I false
+.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/true.c b/src/true.c
new file mode 100644
index 0000000..c2dec42
--- /dev/null
+++ b/src/true.c
@@ -0,0 +1,20 @@
+// true.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 0; }