#!/bin/sh # Copyright © 2000, 2003, 2005 Jamie Zawinski # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation. No representations are made about the suitability of this # software for any purpose. It is provided "as is" without express or # implied warranty. # # Created: 29-Nov-00. progname="$0" exec_dir=`echo $progname | sed 's@/[^/]*$@@'` menuify="$exec_dir/menuify.pl $exec_dir/template.html" verbose="" validate="" usage() { echo "usage: $0 [ --verbose ] [ --validate ] directory" exit 1; } menuify_all() { dir="$1" find "$dir" -name '*.html' -print | sort | \ grep -v 'utils/template\.html$' | grep -v 'backstage/specs/' | exec xargs -n 2000 -s 90000 \ $menuify $verbose $validate } main() { dir='' while [ $# != 0 ]; do case "$1" in -v|-vv|-vvv|-vvvv|-vvvvv|-vvvvvv|-verbose|--verbose ) verbose=$1 shift ;; -validate|--validate ) validate=$1 shift ;; [-]* ) usage; ;; *) if [ "$dir" = "" ]; then dir="$1"; shift; else usage; fi ;; esac done if [ "$dir" = "" ]; then usage; fi menuify_all $dir } main "$@" exit 0;