commit 17a60be5c8278843c92ca27c7ea6bf209753e60d
parent 18f8bd5d5e3743e6d2f1925a1bc785c7427c0527
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 16 May 2025 15:15:59 +0200
Add smeteo utility man page
Diffstat:
3 files changed, 72 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -131,7 +131,7 @@ uninstall:
rm -f "$(DESTDIR)$(PREFIX)/share/doc/star-meteo/README.md"
lint:
- #mandoc -T lint -Wbase doc/smeteo.5
+ mandoc -T lint -Wbase doc/smeteo.1 || [ $$? -le 1 ]
clean: clean_test
rm -f $(DEP) $(OBJ) $(LIBNAME)
diff --git a/doc/smeteo.1 b/doc/smeteo.1
@@ -0,0 +1,70 @@
+.\" Copyright (C) 2025 |Méso|Star> (contact@meso-star.com)
+.\"
+.\" 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 Lesser General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Lesser General Public License
+.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
+.Dd May 16, 2025
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Dt SMETEO 1
+.Os
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh NAME
+.Nm smeteo
+.Nd load and print information on a
+.Xr smeteo 5
+file
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh SYNOPSIS
+.Nm
+.Op Fl hv
+.Op Ar file
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh DESCRIPTION
+Loads a
+.Xr smeteo 5
+file and displays information about it.
+If no file is provided, data is read from standard input.
+.Pp
+On output, it displays the number of meteorological entries loaded and
+the name of the file from which they were loaded.
+The message is formatted as follows:
+.Bd -literal -offset Ds
+"%s %s\\n", entry_count, file
+.Ed
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl h
+Output short help and exit.
+.It Fl v
+Make
+.Nm
+verbose.
+Multiple
+.Fl v
+options increase the verbosity.
+The maximum is 3.
+.El
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh EXIT STATUS
+.Ex -std
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh EXAMPLES
+Load the
+.Qq data.smeteo
+file and make the command as verbose as possible:
+.Bd -literal -offset Ds
+smeteo -vvv data.smeteo
+.Ed
+.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.Sh SEE ALSO
+.Xr smeteo 5
diff --git a/src/smeteo_main.c b/src/smeteo_main.c
@@ -146,6 +146,7 @@ main(int argc, char** argv)
if((res = cmd_init(&cmd, &args)) != RES_OK) goto error;
if((res = cmd_run(&cmd)) != RES_OK) goto error;
+
exit:
cmd_release(&cmd);
CHK(mem_allocated_size() == 0);