freebsd-dev/contrib/libxo/xohtml/xohtml.sh.in
Marcel Moolenaar 3133765886 Import libxo 0.1.4
Obtained from:	https://github.com/Juniper/libxo
Sponsored by:	Juniper Networks, Inc.
2014-10-23 22:30:14 +00:00

56 lines
1.3 KiB
Bash

#!/bin/sh
#
# Copyright (c) 2014, Juniper Networks, Inc.
# All rights reserved.
# This SOFTWARE is licensed under the LICENSE provided in the
# ../Copyright file. By downloading, installing, copying, or otherwise
# using the SOFTWARE, you agree to be bound by the terms of that
# LICENSE.
# Phil Shafer, July 2014
#
BASE=@XO_SHAREDIR@
CMD=cat
DONE=
while [ -z "$DONE" -a ! -z "$1" ]; do
case "$1" in
-b|--base)
shift;
BASE="$1";
shift;
;;
-c|--command)
shift;
CMD="$1";
shift;
;;
-f|--file)
shift;
FILE="$1";
shift;
exec > "$FILE";
;;
*)
DONE=1;
;;
esac
done
echo "<html>\n<head>\n"
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>'
echo '<link rel="stylesheet" href="'$BASE'/xohtml.css">'
echo '<link rel="stylesheet" href="'$BASE'/external/jquery.qtip.css"/>'
echo '<script type="text/javascript" src="'$BASE'/external/jquery.js"></script>'
echo '<script type="text/javascript" src="'$BASE'/external/jquery.qtip.js"></script>'
echo '<script type="text/javascript" src="'$BASE'/xohtml.js"></script>'
echo '<script>'
echo '</script>'
echo "</head>\n<body>\n"
$CMD
echo "</body>\n</html>\n"
exit 0