File indexing completed on 2024-04-21 05:40:20

0001 #!/bin/sh
0002 #
0003 # Copyright (c) 2018, Michal Policht. This file is dually licensed under terms of 
0004 # either WTFPL or BEER-WARE LICENSE. You may obtain the copy of WTFPL or BEER-WARE
0005 # LICENSE by googling it. NO WARRANTY. YOU WILL PAY ALL COSTS FOR ANY REPAIRS.
0006 #
0007 # For a given Doxygen file path, prints a product entry that can be used in
0008 # a documentation.
0009 #
0010 # usage: docprodentry.sh doxygen_file
0011 # example: docprodentry.sh extensions/CuteHMI.2/cutehmi.doxygen.Doxyfile
0012 #
0013 # parameters:
0014 # doxygen_file - a Doxygen file.
0015 #
0016 # required tools: sh, dirname, echo, sed.
0017 
0018 
0019 usage()
0020 {
0021     echo "usage: $0 doxygen_file"
0022 }
0023 
0024 doxygen_file=$1
0025 
0026 if [ ! -e $doxygen_file ]; then
0027         echo $doxygen_file "does not exist"
0028         exit 1
0029 fi      
0030 
0031 if [ $# -lt 1 ]; then
0032     echo "error: too few arguments"
0033     usage
0034     exit 0
0035 fi
0036 
0037 dir=$(dirname $doxygen_file)
0038 subdir=${dir#*/}
0039 prodname=$(echo "$subdir" | sed 's|/|\.|g' | sed 's|\(.*\)\.|\1 |')
0040 echo - \<a href=\"$dir/index.html\"\>$prodname\<\/a\>
0041