#!/bin/bash
#
# mkpod
# Copyright (C) 2007 Hewlett-Packard Development Company, L.P.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
#
# simple script to generate man pages from pod sources
# TODO: process version parameter.... need to be able to pass one in.
#
usage='mkpod <input-file>, input file should be a pod file.'

infile=$1
version=$2
if [[ -z $infile ]]
then
	echo $usage
fi

if [[ -z $version ]]
then
	echo "Setting version to 0.dev"
	version='0.dev'
fi

name=${infile%.pod}

#echo "name is:$name"
#exit

pod2man --center="$name" --release="Version $version" "$infile" > "$name.1"

# HTML
pod2html --infile=$infile --outfile=$name.html

#Text
pod2text $infile $name.txt

