mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Renaming ehelp to ede-help
This commit is contained in:
45
ede-help/Jamfile
Normal file
45
ede-help/Jamfile
Normal file
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Part of Equinox Desktop Environment (EDE).
|
||||
# Copyright (c) 2008 EDE Authors.
|
||||
#
|
||||
# This program is licensed under the terms of the
|
||||
# GNU General Public License version 2 or later.
|
||||
# See COPYING for the details.
|
||||
|
||||
SubDir TOP ehelp ;
|
||||
|
||||
rule MakeScript
|
||||
{
|
||||
# add grist to file names (not needed, but you never know...)
|
||||
local source = [ FGristFiles $(>) ] ;
|
||||
|
||||
# let jam call from the top directory (jam ehelp) knows what to
|
||||
# build and not be confused with the same name of directory
|
||||
SEARCH on $(source) = $(SUBDIR) ;
|
||||
|
||||
LocalDepends $(<) : $(source) ;
|
||||
LocalDepends all : $(<) ;
|
||||
LocalClean clean : $(<) ;
|
||||
|
||||
# where generated target will be located
|
||||
MakeLocate $(<) : $(LOCATE_TARGET) ;
|
||||
|
||||
MakeScript1 $(<) : $(source) ;
|
||||
|
||||
# let it be installed on 'jam install'
|
||||
InstallEdeProgram $(<) ;
|
||||
|
||||
# make it executable
|
||||
MODE on $(<) = $(EXEMODE) ;
|
||||
Chmod $(<) ;
|
||||
}
|
||||
|
||||
actions existing MakeScript1
|
||||
{
|
||||
cat "$(>)" | $(SED) -e 's|@ededocdir@|$(EDEDOCDIR)|' > "$(<)"
|
||||
}
|
||||
|
||||
MakeScript ehelp : ehelp.in ;
|
||||
EdeManual ehelp.txt ;
|
82
ede-help/ehelp.in
Normal file
82
ede-help/ehelp.in
Normal file
@@ -0,0 +1,82 @@
|
||||
#!/bin/sh
|
||||
|
||||
help_dir="@ededocdir@/manual"
|
||||
browser_list="firefox mozilla konqueror opera navigator dillo"
|
||||
|
||||
program="ehelp"
|
||||
url=""
|
||||
|
||||
if [ "$1" = "--help" ]; then
|
||||
cat <<EOF
|
||||
Usage: $program [OPTIONS] [TITLE]
|
||||
Display EDE Manual in the web browser
|
||||
Options:
|
||||
--help Show this help
|
||||
--titles Show known titles
|
||||
|
||||
Example:
|
||||
$program evoke - display evoke help
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$1" = "--titles" ]; then
|
||||
echo "Known titles:"
|
||||
|
||||
content=`ls $help_dir/ | sort -f`
|
||||
for c in $content; do
|
||||
# show only files (readable), stripping extension
|
||||
[ -r "$help_dir/$c" ] && echo " " $c | sed 's/\.html//g'
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
url="$help_dir/index.html"
|
||||
else
|
||||
url="$help_dir/$1.html"
|
||||
if [ ! -r "$url" ]; then
|
||||
echo "Unable to open $1. Going to start page..."
|
||||
url="$help_dir/index.html"
|
||||
fi
|
||||
fi
|
||||
|
||||
# let browser knows it is a file
|
||||
url="file://$url"
|
||||
|
||||
# try to find browser
|
||||
if [ -z "$BROWSER" ]; then
|
||||
for i in $browser_list; do
|
||||
if which $i > /dev/null 2>&1; then
|
||||
BROWSER="$i"
|
||||
break;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -z $BROWSER ]; then
|
||||
xmessage -title "$program error" -center -buttons "Close" -file - <<EOF
|
||||
Failed to find any of known browsers!
|
||||
|
||||
If you thing that I made mistake, please try to set
|
||||
BROWSER environment variable with full path pointing
|
||||
to the browser binary
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# run browser
|
||||
$BROWSER $url
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
xmessage -title "$program error" -center -buttons "Close" -file - <<EOF
|
||||
Unable to run '$BROWSER'!
|
||||
|
||||
Please check if program path is correct or
|
||||
adjust BROWSER environment variable pointing
|
||||
to the correct binary
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
48
ede-help/ehelp.txt
Normal file
48
ede-help/ehelp.txt
Normal file
@@ -0,0 +1,48 @@
|
||||
Ehelp documentation
|
||||
===================
|
||||
|
||||
Ehelp is program that will display EDE help in web browser. It will use
|
||||
a list of predefined browsers and if find one of them, it will run it.
|
||||
|
||||
Running 'ehelp' without options will open help's starting page. On other
|
||||
hand, if you want to display a help of some program or documentation about
|
||||
some services, running 'ehelp [program-name-or-service]' will do that.
|
||||
|
||||
.Displaying evoke help
|
||||
------------------------------
|
||||
ehelp evoke
|
||||
------------------------------
|
||||
|
||||
In case you are not sure for what programs help exists, using '--titles'
|
||||
option will show it.
|
||||
|
||||
.Using '--titles' option
|
||||
------------------------------
|
||||
$ehelp --titles
|
||||
|
||||
Known titles:
|
||||
HACKING
|
||||
contact
|
||||
dbus-usage
|
||||
ecalc
|
||||
emountd
|
||||
etip
|
||||
evoke
|
||||
images
|
||||
index
|
||||
introduction
|
||||
jambuild
|
||||
------------------------------
|
||||
|
||||
|
||||
If you don't like browser ehelp chooses, you can change it pointing
|
||||
$BROWSER environment variable to desired program.
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
--help::
|
||||
Display help
|
||||
|
||||
--titles::
|
||||
Display a list of known titles
|
Reference in New Issue
Block a user