Let ehelp be installed.

Some cosmetic modifications.
This commit is contained in:
Sanel Zukan 2008-08-10 17:44:25 +00:00
parent 530a815246
commit b792d13603
2 changed files with 22 additions and 18 deletions

View File

@ -10,4 +10,5 @@
SubDir TOP ehelp ; SubDir TOP ehelp ;
InstallEdeProgram ehelp ;
EdeManual ehelp.txt ; EdeManual ehelp.txt ;

View File

@ -1,29 +1,32 @@
#!/bin/sh #!/bin/sh
#help_dir="/home/sanel/programs/EDE/ede2/docs/manual"
help_dir="@docdir@/ede/manual" help_dir="@docdir@/ede/manual"
browser_list="firefox mozilla konqueror opera navigator dillo" browser_list="firefox mozilla konqueror opera navigator dillo"
program="ehelp"
url="" url=""
if [ "$1" = "--help" ]; then if [ "$1" = "--help" ]; then
echo "Usage: ehelp [OPTIONS] [TITLE]" cat <<EOF
echo "Display EDE Manual in the web browser" Usage: $program [OPTIONS] [TITLE]
echo "Options:" Display EDE Manual in the web browser
echo " --help Show this help" Options:
echo " --titles Show known titles" --help Show this help
echo "" --titles Show known titles
echo "Example:"
echo " ehelp evoke - display evoke help" Example:
$program evoke - display evoke help
EOF
exit 1 exit 1
fi fi
if [ "$1" = "--titles" ]; then if [ "$1" = "--titles" ]; then
echo "Known titles:" echo "Known titles:"
content=`ls $help_dir/ | sort` content=`ls $help_dir/ | sort -f`
for c in $content; do for c in $content; do
echo " " $c | sed 's/\.html//g' # show only files (readable), stripping extension
[ -r "$help_dir/$c" ] && echo " " $c | sed 's/\.html//g'
done done
exit 0 exit 0
fi fi
@ -32,13 +35,13 @@ if [ -z "$1" ]; then
url="$help_dir/index.html" url="$help_dir/index.html"
else else
url="$help_dir/$1.html" url="$help_dir/$1.html"
if [ ! -f "$url" ]; then if [ ! -r "$url" ]; then
echo "Unable to find $1. Going to start page..." echo "Unable to open $1. Going to start page..."
url="$help_dir/index.html" url="$help_dir/index.html"
fi fi
fi fi
# let browser knows it is file # let browser knows it is a file
url="file://$url" url="file://$url"
# try to find browser # try to find browser
@ -52,8 +55,8 @@ if [ -z "$BROWSER" ]; then
fi fi
if [ -z $BROWSER ]; then if [ -z $BROWSER ]; then
xmessage -title "Error" -center -file - <<EOF xmessage -title "$program error" -center -buttons "Close" -file - <<EOF
Failed to find any of known browsers ($browser_list). Failed to find any of known browsers!
If you thing that I made mistake, please try to set If you thing that I made mistake, please try to set
BROWSER environment variable with full path pointing BROWSER environment variable with full path pointing
@ -66,8 +69,8 @@ fi
$BROWSER $url $BROWSER $url
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
xmessage -title "Error" -center -file - <<EOF xmessage -title "$program error" -center -buttons "Close" -file - <<EOF
Unable to run '$BROWSER'. Unable to run '$BROWSER'!
Please check if program path is correct or Please check if program path is correct or
adjust BROWSER environment variable pointing adjust BROWSER environment variable pointing