From 1d8e1252bff2523e753d9983cdfa833fdc3be6d0 Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Sat, 14 Oct 2023 11:19:32 +0200 Subject: [PATCH 1/3] add(doc): initial man page --- doc/sp.1 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 doc/sp.1 diff --git a/doc/sp.1 b/doc/sp.1 new file mode 100644 index 0000000..e41ce38 --- /dev/null +++ b/doc/sp.1 @@ -0,0 +1,38 @@ +.\" This is the groff documentation source for sp +.\" +.\" Preview with: groff -man -Tascii sp.1 +.\" or: man -l sp.1 +.\" + +.TH SP 1 "2023-10-14" "User Commands" +.SH NAME +sp \- A ispell wrapper to automatically correct spelling errors +.SH SYNOPSIS +.B sp +.RI WORD +. +.SH DESCRIPTION +.B sp +Is a cli tool to automatically select the first correction of the provided word using gnu/linux ispell. +.PP +sp is a wrapper program around ispell +. +.SH EXAMPLES +sp opprotunity +.PP +echo opprotunity | sp +.PP +Both sp executions will result into the same output of +.I opportunity +wether you provide the word as an command line argument or pipe the argument to sp. +. +.SH AUTHOR +Written by Yves Biener. +Man page by Yves Biener. +. +.SH BUGS +Please report bugs at +.IR https://gitea.yves-biener.de/yves-biener/sp/issues +. +.SH COPYRIGHT +This software is provided by Yves Biener ''as is'' and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall Yves Biener be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. -- 2.49.1 From 7d10ee4c750f7bfb0646ddcc6cceefb04dc27c38 Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Sat, 14 Oct 2023 11:59:49 +0200 Subject: [PATCH 2/3] add(build): include man page in installation build step --- build.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.zig b/build.zig index 7958a52..3763541 100644 --- a/build.zig +++ b/build.zig @@ -23,6 +23,8 @@ pub fn build(b: *std.Build) void { .target = target, .optimize = optimize, }); + // install man pages along executable + b.installFile("doc/sp.1", "man/man1/sp.1"); // This declares intent for the executable to be installed into the // standard location when the user invokes the "install" step (the default -- 2.49.1 From bea48612325d11ac7aff9a4bf29e6fb913cdaa00 Mon Sep 17 00:00:00 2001 From: Yves Biener Date: Sat, 14 Oct 2023 12:06:49 +0200 Subject: [PATCH 3/3] doc: update installation documentation --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a85eeff..cf04f3f 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,28 @@ Spellchecking utility to provide automatic corrected spelling for the provided input using GNU/linux ispell. +## Dependencies + +Install `ispell` with your favorite package-manager (on manually), as long as `ispell` in available in the PATH environment variable sp will find the executable to run. + ## Installation Build the tool using the following command: -```bash +```sh zig build -Doptimize=ReleaseFast ``` +If you wish to install it into */usr/local/* you will have to provide the prefix argument: + +```sh +sudo zig build install -p /usr/local/ -DoptimizeReleaseFast +``` + This was build using zig 0.12.0.dev but should work with the most recent version of zig. -Add the build `sp` executable in your `PATH` environment to easily invoke the tool. +Add the build `sp` executable in your `PATH` environment or install it using the prefix argument to easily invoke the tool. + ## Usage @@ -23,3 +34,9 @@ sp pple # is equivalent to echo pple | sp ``` + +When running the installation you also install the man page for `sp`. In case you installed in */usr/local/* as the prefix argument you can simply run + +```sh +man sp +``` -- 2.49.1