Send stacktrace data also to a /tmp file
[geeqie.git] / scripts / generate-man-page.sh
1 #!/bin/sh
2
3 ## @file
4 ## @brief Create the man page from the output of the "geeqie--help" command
5 ## and also create the xml file for Command Line Options
6 ##
7 ## This needs to be run only when the command line options change
8 ##
9 ## The programs help2man and doclifter are required - both are available as .deb packages.
10 ##
11
12 if ! command -v help2man > /dev/null
13 then
14         printf '%s\n' "help2man not installed"
15         exit 1
16 fi
17
18 if ! command -v doclifter > /dev/null
19 then
20         printf '%s\n' "doclifter not installed"
21         exit 1
22 fi
23
24 if  [ ! -f build/src/geeqie  ]
25 then
26         printf '%s\n' "geeqie executable has not been built"
27         exit 1
28 fi
29
30 options_file=$(mktemp "${TMPDIR:-/tmp}/geeqie.XXXXXXXXXX")
31 year=$(date +"%Y")
32
33 printf '%s\n' "[NAME]
34 Geeqie - GTK based multiformat image viewer
35
36 [DESCRIPTION]
37 Geeqie is an interactive GTK based image viewer that supports multiple image formats,
38 zooming, panning, thumbnails and sorting images into collections.
39
40 Generated for version:
41
42 [SEE ALSO]
43 Full documentation: https://www.geeqie.org/help/GuideIndex.html
44
45 [BUGS]
46 Please send bug reports and feedback to https://github.com/BestImageViewer/geeqie/issues
47
48 [COPYRIGHT]
49 Copyright (C) 1999-2004 by John Ellis. Copyright (C) 2004-$year by The Geeqie Team. Use this software  at  your
50 own  risk! This  software released under the GNU General Public License. Please read the COPYING file for more
51 information." > "$options_file"
52
53 help2man --no-info --include="$options_file" build/src/geeqie > geeqie.1
54
55 doclifter geeqie.1
56 mv geeqie.1.xml doc/docbook/CommandLineOptions.xml
57
58 rm "$options_file"