tools: Allow setting the output format for the docs

This commit is contained in:
Wido den Hollander 2013-04-12 15:07:24 +02:00
parent 7753275b37
commit 0f8a46c580
1 changed files with 5 additions and 2 deletions

View File

@ -19,22 +19,25 @@
sourcedir=~/incubator-cloudstack/
common_content_dir=/usr/share/publican/Common_Content
publican_path=/usr/bin/publican
output_format="html,pdf"
usage(){
echo "usage: $0 [-s source dir] [-c publican common content] [-p path to publican]"
echo " -s sets the source directory (defaults to $sourcedir)"
echo " -c sets the public common content directory (defaults to $common_content_dir)"
echo " -p sets the path to the publican binary (defaults to $publican_path)"
echo " -f sets the output format (defaults to $output_format)"
echo " -h"
}
while getopts v:s:c:p:h opt
while getopts v:s:c:p:f:h opt
do
case "$opt" in
v) version="$OPTARG";;
s) sourcedir="$OPTARG";;
c) common_content_dir="$OPTARG";;
p) publican_path="$OPTARG";;
f) output_format="$OPTARG";;
h) usage
exit 0;;
\?)
@ -56,5 +59,5 @@ fi
cd $sourcedir/docs
cp -R /usr/share/publican/Common_Content .
ln -s $sourcedir/docs/publican-cloudstack Common_Content/cloudstack
publican build --config=publican-installation.cfg --formats html,pdf --langs en-US --common_content=$sourcedir/docs/Common_Content
publican build --config=publican-installation.cfg --formats $output_format --langs en-US --common_content=$sourcedir/docs/Common_Content
rm -r Common_Content