aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2025-06-29 21:03:01 -0400
committerEugene Triguba <eugenetriguba@gmail.com>2025-06-29 21:03:01 -0400
commit571cfa50d2955f1bb49c406554d1de041d58614f (patch)
tree26bbe1fdbe466c2147d630a056faab8ad1710e1c
parentFix justify behavior (diff)
downloadcli-571cfa50d2955f1bb49c406554d1de041d58614f.zip
Add documentation for how to install justify cli
-rw-r--r--.dockerignore5
-rw-r--r--CMakeLists.txt3
-rw-r--r--README.md26
-rw-r--r--doc/justify.11
4 files changed, 35 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..8c9aa45
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,5 @@
+/.cache
+/.git
+/.github
+/build
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c825be..04194ea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,9 @@ set(SRC_FILES
include_directories(src)
add_executable(justify ${SRC_FILES})
+install(TARGETS justify RUNTIME DESTINATION bin)
+install(FILES doc/justify.1 DESTINATION share/man/man1)
+
include(CTest)
if(BUILD_TESTING)
add_subdirectory(tests)
diff --git a/README.md b/README.md
index 6c40843..20cee3a 100644
--- a/README.md
+++ b/README.md
@@ -22,3 +22,29 @@ documents.
`justify` achieves this by adding extra space between words or letters to
ensure that each line extends to the right margin. The last line of a
paragraph is not justified and is aligned left.
+
+## Installation
+
+1. Clone the repository
+```sh
+$ git clone https://github.com/eugenetriguba/justify
+$ cd justify
+```
+
+2. Create a build directory and build the project
+```
+$ cmake -B build -DCMAKE_BUILD_TYPE=Release
+$ cmake --build build
+```
+
+3. Install the binary and man page (may require sudo)
+```sh
+$ sudo cmake --install build
+```
+
+This will:
+- Install the `justify` binary to your system’s default binary directory (e.g., `/usr/local/bin`)
+- Install the man page to the appropriate man directory (e.g., `/usr/local/share/man/man1`)
+
+You can then use the `justify` CLI and view the man page via `man justify`.
+
diff --git a/doc/justify.1 b/doc/justify.1
index 611f1ae..ccff202 100644
--- a/doc/justify.1
+++ b/doc/justify.1
@@ -17,6 +17,7 @@ Set the line width for justification. The default is 72 characters.
.SH USAGE
Input is read from standard input. Output is written to standard output.
+Any error output is written to standard error.
To justify a file to 80 columns:
.RS