Replaced unbound record elements with null pointers in record-ofs (bug 494614)
[deliverable/titan.core.git] / help / ttcn3_help
CommitLineData
970ed795
EL
1#! /bin/sh
2#
3#! /bin/sh -x
4###############################################################################
3abe9331 5# Copyright (c) 2000-2015 Ericsson Telecom AB
970ed795
EL
6# All rights reserved. This program and the accompanying materials
7# are made available under the terms of the Eclipse Public License v1.0
8# which accompanies this distribution, and is available at
9# http://www.eclipse.org/legal/epl-v10.html
10###############################################################################
11
12###############################################################################
13# Shell script: ttcn3_help
14# Part of : TITAN
15# Purpose : opening help pages
16# Content :
17# The followings can be configured
18# browser: the application which opens the help page
19# (netscape by default)
20# browser_options: command line options for the browser
21# help_format: extension of the help files
22# help_root: root of the help files
23#
24# Return value: 1 on error
25# 0 on success
26###############################################################################
27
28# check the number of arguments
29if test "`expr $# != 1`" = "1"
30then echo "Error: exactly one argument is expected"; exit 1;
31fi
32
33# check for necessary environment variables
34if test "${TTCN3_DIR}" = ""
35then echo "Error: TTCN3_DIR environment variable is not set"; exit 1;
36fi
37
38# file extension for help files
39help_format=".html";
40# path of the help pages
41help_root="${TTCN3_DIR}/help";
42
43# check for browser
44if test "${TTCN3_BROWSER}" = ""
45then browser="netscape"; browser_options="-no-about-splash ";
46else browser="${TTCN3_BROWSER}"; browser_options=" ";
47fi
48
49# check for already running browsers
50# Netscape
51if test "`echo ${browser} | grep netscape`" != ""
52then {
53 username=`whoami`
54 # avoid listing grep command as well
55 pslist=`/bin/ps -u ${username} -f`
56 if test "`echo ${pslist} | grep netscape`" != ""
57 then browser_options="-remote openURL(file:"; endtag=")"
58 else browser_options="-no-about-splash "; endtag=""
59 fi
60}
61# Mozilla
62elif test "`echo ${browser} | grep mozilla`" != ""
63then {
64 username=`whoami`
65 # avoid listing grep command as well
66 pslist=`/bin/ps -u ${username}`
67 if test "`echo ${pslist} | grep mozilla`" != ""
68 then browser_options="-remote openURL(file:"; endtag=")"
69 else browser_options="file:"; endtag=""
70 fi
71}
72# Opera
73elif test "`echo ${browser} | grep opera`" != ""
74then {
75 username=`whoami`
76 # avoid listing grep command as well
77 pslist=`/bin/ps -u ${username} -f`
78 if test "`echo ${pslist} | grep opera`" != ""
79 then browser_options="-remote openURL(file:"; endtag=")"
80 else endtag=""
81 fi
82}
83# Lynx should be executed in a new terminal
84elif test "`echo ${browser} | grep lynx`" != ""
85then {
86 browser="xterm -e ${browser}"
87 endtag=""
88}
89else endtag=""
90fi
91
92#echo "browser=$browser"
93#echo "options=$browser_options"
94#echo "endtag =$endtag"
95
96# the file tree looks like
97# $TTCN3_DIR/help/titan_main.html
98# $TTCN3_DIR/help/titan_index.html
99# $TTCN3_DIR/help/info/<keyword>.html
100
101##### check if it is a document name #####
102if test -f ${help_root}/$1
103then exec ${browser} ${browser_options}${help_root}/$1${endtag}
104elif test -f ${help_root}/info/$1
105then exec ${browser} ${browser_options}${help_root}/info/$1${endtag}
106
107##### check if it is the keyword 'main' #####
108elif test $1 = "main"
109then exec ${browser} ${browser_options}${help_root}/titan_main${help_format}${endtag}
110
111##### check if it is a keyword #####
112elif test -f ${help_root}/info/$1${help_format}
113then exec ${browser} ${browser_options}${help_root}/info/$1${help_format}${endtag}
114
115# otherwise open the index file
116else exec ${browser} ${browser_options}${help_root}/titan_index${help_format}${endtag}
117fi
118
This page took 0.027392 seconds and 5 git commands to generate.