Blob Blame History Raw
From 07c371f68ccc10337fbdd60477bc621bf7cd2a7e Mon Sep 17 00:00:00 2001
From: Daniel Moerner <dmoerner@gmail.com>
Date: Tue, 17 Jan 2017 11:49:15 -0500
Subject: [PATCH] Write manpage based on README.

---
 CMakeLists.txt   |  6 +++-
 minetestmapper.6 | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 1 deletion(-)
 create mode 100644 minetestmapper.6

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 255c82f..4b54d64 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,9 +21,10 @@ if(WIN32)
 	set(BINDIR ".")
 	set(DOCDIR ".")
 else()
-	set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/minetest") # an extra dir. for just one file doesn't seem useful
+	set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/minetest") # reuse Minetest share dir
 	set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
 	set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
+	set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
 endif()
 
 set(CUSTOM_SHAREDIR "" CACHE STRING "Directory to install data files into")
@@ -215,6 +216,9 @@ install(FILES "AUTHORS" DESTINATION "${DOCDIR}")
 install(FILES "COPYING" DESTINATION "${DOCDIR}")
 install(FILES "README.rst" DESTINATION "${DOCDIR}")
 install(FILES "colors.txt" DESTINATION "${SHAREDIR}")
+if(UNIX)
+	install(FILES "minetestmapper.6" DESTINATION "${MANDIR}/man6")
+endif()
 
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Overview mapper for Minetest")
 set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
diff --git a/minetestmapper.6 b/minetestmapper.6
new file mode 100644
index 0000000..5cdd6d9
--- /dev/null
+++ b/minetestmapper.6
@@ -0,0 +1,91 @@
+.TH MINETESTMAPPER 6
+.SH NAME
+minetestmapper \- generate an overview image of a Minetest map
+.SH SYNOPSIS
+.B minetestmapper
+\fB\-i\fR \fIworld_path\fR
+\fB\-o\fR \fIoutput_image\fR
+.PP
+See additional optional parameters below.
+.SH DESCRIPTION
+.B minetestmapper
+generates an overview image of a minetest map. This is a port of
+the original minetestmapper.py to C++, that is both faster and
+provides more funtionality than the deprecated Python script.
+.SH MANDATORY PARAMETERS
+.TP
+.BR \-i " " \fIworld_path\fR
+Input world path.
+.TP
+.BR \-o " " \fIoutput_image\fR
+Path to output image. (only PNG supported currently)
+.SH OPTIONAL PARAMETERS
+.TP
+.BR \-\-bgcolor " " \fIcolor\fR
+Background color of image, e.g. "--bgcolor #ffffff"
+
+.TP
+.BR \-\-scalecolor " " \fIcolor\fR
+Color of scale, e.g. "--scalecolor #000000"
+
+.TP
+.BR \-\-playercolor " " \fIcolor\fR
+Color of player indicators, e.g. "--playercolor #ff0000"
+
+.TP
+.BR \-\-origincolor " " \fIcolor\fR
+Color of origin indicator, e.g. "--origincolor #ff0000"
+
+.TP
+.BR \-\-drawscale
+Draw tick marks
+
+.TP
+.BR \-\-drawplayers
+Draw player indicators
+
+.TP
+.BR \-\-draworigin
+Draw origin indicator
+
+.TP
+.BR \-\-drawalpha
+Allow nodes to be drawn with transparency
+
+.TP
+.BR \-\-noshading
+Don't draw shading on nodes
+
+.TP
+.BR \-\-min-y " " \fInumber\fR
+Don't draw nodes below this y value, e.g. "--min-y -25"
+
+.TP
+.BR \-\-max-y " " \fInumber\fR
+Don't draw nodes above this y value, e.g. "--max-y 75"
+
+.TP
+.BR \-\-backend " " \fIbackend\fR
+Use specific map backend; supported: *sqlite3*, *leveldb*, *redis*, *postgresql*, e.g. "--backend leveldb"
+
+.TP
+.BR \-\-geometry " " \fIgeometry\fR
+Limit area to specific geometry (*x:y+w+h* where x and y specify the lower left corner), e.g. "--geometry -800:-800+1600+1600"
+
+.TP
+.BR \-\-zoom " " \fIfactor\fR
+Zoom the image by using more than one pixel per node, e.g. "--zoom 4"
+
+.TP
+.BR \-\-colors " " \fIpath\fR
+Forcefully set path to colors.txt file (it's autodetected otherwise), e.g. "--colors ../minetest/mycolors.txt"
+
+.TP
+.BR \-\-scales " " \fIedges\fR
+Draw scales on specified image edges (letters *t b l r* meaning top, bottom, left and right), e.g. "--scales tbr"
+
+.SH MORE INFORMATION
+Website: https://github.com/minetest/minetestmapper
+
+.SH MAN PAGE AUTHOR
+Daniel Moerner