Auto-generate the man page
[geeqie.git] / scripts / generate-man-page.sh
1 #!/bin/bash
2 # Create the man page from the output of the "geeqie--help" command
3 # and also create the xml file for Command Line Options
4 #
5 # This needs to be run only when the command line options change
6
7 command -v help2man > /dev/null
8 if [ $? -eq 1 ]
9 then
10         echo "help2man not installed"
11         exit
12 fi
13
14 command -v doclifter > /dev/null
15 if [ $? -eq 1 ]
16 then
17         echo "doclifter not installed"
18         exit
19 fi
20
21 options_file=$(mktemp)
22
23 echo "[NAME]
24 Geeqie - GTK based multiformat image viewer
25
26 [DESCRIPTION]
27 Geeqie is an interactive GTK based image viewer that supports multiple image formats,
28 zooming, panning, thumbnails and sorting images into collections.
29
30 Generated for version:
31
32 [SEE ALSO]
33 Full documentation: https://www.geeqie.org/help/GuideIndex.html
34
35 [BUGS]
36 Please send bug reports and feedback to https://github.com/BestImageViewer/geeqie/issues
37
38 [COPYRIGHT]
39 Copyright (C) 1999-2004 by John Ellis. Copyright (C) 2004-2021 by The Geeqie Team. Use this software  at  your
40 own  risk! This  software released under the GNU General Public License. Please read the COPYING file for more
41 information." > "$options_file"
42
43
44 help2man --no-info --include="$options_file" src/geeqie > geeqie.1
45
46 doclifter geeqie.1
47 mv geeqie.1.xml doc/docbook/CommandLineOptions.xml
48
49 rm "$options_file"