Skip to content

Instantly share code, notes, and snippets.

@lgrz
Last active December 29, 2015 15:19
Show Gist options
  • Save lgrz/7689970 to your computer and use it in GitHub Desktop.
Save lgrz/7689970 to your computer and use it in GitHub Desktop.
#!/bin/bash
BROWSER="links"
PHPDOC="/path/to/doc/php/"
if [ "$#" -ne 1 ]; then
echo "usage: phpman class|function"
exit
fi
NAME=`echo -n "$1" | tr _ - | tr A-Z a-z`
for i in "${PHPDOC}class.${NAME}.html" "${PHPDOC}function.${NAME}.html"; do
if [ ! -f "${i}" ]; then
continue
fi
$BROWSER $i
exit 0
done
echo "No manual for ${i}!"
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment