Subversion Repositories lagranto.wrf

Rev

Rev 2 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 10
1
#!/bin/csh
1
#!/bin/csh
2
 
2
 
3
# ---------------------------------------------------------------------------
3
# ---------------------------------------------------------------------------
4
# Set parameters - handle arguments 
4
# Set parameters - handle arguments 
5
# ---------------------------------------------------------------------------
5
# ---------------------------------------------------------------------------
6
 
6
 
7
set dir    = ${LAGRANTO}/docu/
7
set dir    = ${LAGRANTO}/docu/
8
set viewer = xpdf
8
set viewer = xpdf
9
set nargv  = ${#argv}
9
set nargv  = ${#argv}
10
 
10
 
11
if ( (${#argv} == 0) ) then
11
if ( (${#argv} == 0) ) then
12
    nroff -man ${dir}/man/lagrantohelp.0 | less
12
    nroff -man ${dir}/man/lagrantohelp.0 | less
13
    exit 0
13
    exit 0
14
endif
14
endif
15
 
15
 
16
if ( "${nargv}" == "1" ) then
16
if ( "${nargv}" == "1" ) then
17
   set mode = "$1"
17
   set mode = "$1"
18
   set verb = "long"
18
   set verb = "long"
19
else if ( "${nargv}" == "2" ) then
19
else if ( "${nargv}" == "2" ) then
20
   set mode = "$1"
20
   set mode = "$1"
21
   set verb = "$2"
21
   set verb = "$2"
22
endif
22
endif
23
 
23
 
24
# ---------------------------------------------------------------------------
24
# ---------------------------------------------------------------------------
25
# Tutorial, Reference, Presentation, Future Plans
25
# Tutorial, Reference, Presentation, Future Plans
26
# ---------------------------------------------------------------------------
26
# ---------------------------------------------------------------------------
27
 
27
 
28
if ( "$mode" == "future" ) then
28
if ( "$mode" == "future" ) then
29
    nroff -man ${dir}/man/futureplans.0 | less
29
    nroff -man ${dir}/man/futureplans.0 | less
30
    exit 0
30
    exit 0
31
endif
31
endif
32
 
32
 
33
if ( "$mode" == "tutorial" ) then
33
if ( "$mode" == "tutorial" ) then
34
    ${viewer} ${dir}/tutorial/tutorial.pdf 
34
    ${viewer} ${dir}/tutorial/tutorial.pdf 
35
    exit 0
35
    exit 0
36
endif
36
endif
37
 
37
 
38
if ( "$mode" == "reference" ) then
38
if ( "$mode" == "reference" ) then
39
    ${viewer} ${dir}/reference/reference.pdf
39
    ${viewer} ${dir}/reference/reference.pdf
40
    exit 0
40
    exit 0
41
endif
41
endif
42
 
42
 
43
if ( "$mode" == "presentation" ) then
43
if ( "$mode" == "presentation" ) then
44
    ${viewer} ${dir}/presentation/presentation.pdf
44
    ${viewer} ${dir}/presentation/presentation.pdf
45
    exit 0
45
    exit 0
46
endif
46
endif
47
 
47
 
48
# ---------------------------------------------------------------------------
48
# ---------------------------------------------------------------------------
49
# Manual
49
# Manual
50
# ---------------------------------------------------------------------------
50
# ---------------------------------------------------------------------------
51
 
51
 
52
if ( "${verb}" == "long" ) then
52
if ( "${verb}" == "long" ) then
53
    nroff -man ${dir}/man/${mode}.0 | less
53
    nroff -man ${dir}/man/${mode}.0 | less
54
    exit 0
54
    exit 0
55
endif
55
endif
56
 
56
 
57
if ( "${verb}" == "short" ) then
57
if ( "${verb}" == "short" ) then
58
    echo
58
    echo
59
    nroff -man ${dir}/man/${mode}.0 | grep -A 1 SYNOPSIS
59
    nroff -man ${dir}/man/${mode}.0 | grep -A 1 SYNOPSIS
60
    echo
60
    echo
61
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES | awk -F ":" '{print $1}'`
61
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES | awk -F ":" '{print $1}'`
62
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n AUTHOR   | awk -F ":" '{print $1}'`
62
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n AUTHOR   | awk -F ":" '{print $1}'`
63
    set i1 = `echo "$i1 - 1" | bc`  
63
    set i1 = `echo "$i1 - 1" | bc`  
64
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
64
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
65
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
65
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
66
    endif
66
    endif
67
endif
67
endif
68
 
68
 
69
if ( "${verb}" == "synopsis" ) then
69
if ( "${verb}" == "synopsis" ) then
70
    echo
70
    echo
71
    nroff -man ${dir}/man/${mode}.0 | grep -A 1 SYNOPSIS
71
    nroff -man ${dir}/man/${mode}.0 | grep -A 1 SYNOPSIS
72
    echo
72
    echo
73
    exit 0
73
    exit 0
74
endif
74
endif
75
 
75
 
76
if ( "${verb}" == "parameter" ) then
76
if ( "${verb}" == "parameter" ) then
77
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n PARAMETERS | awk -F ":" '{print $1}'`
77
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n PARAMETERS | awk -F ":" '{print $1}'`
78
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES   | awk -F ":" '{print $1}'`
78
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES   | awk -F ":" '{print $1}'`
79
    set i1 = `echo "$i1 - 1" | bc`
79
    set i1 = `echo "$i1 - 1" | bc`
80
    echo $i0
80
    echo $i0
81
    echo $i1
81
    echo $i1
82
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
82
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
83
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
83
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
84
    endif
84
    endif
85
    exit 0
85
    exit 0
86
endif
86
endif
87
 
87
 
88
if ( "${verb}" == "examples" ) then
88
if ( "${verb}" == "examples" ) then
89
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES | awk -F ":" '{print $1}'`
89
    set i0 = `nroff -man ${dir}/man/${mode}.0 | grep -n EXAMPLES | awk -F ":" '{print $1}'`
90
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n AUTHOR   | awk -F ":" '{print $1}'`
90
    set i1 = `nroff -man ${dir}/man/${mode}.0 | grep -n AUTHOR   | awk -F ":" '{print $1}'`
91
    set i1 = `echo "$i1 - 1" | bc`  
91
    set i1 = `echo "$i1 - 1" | bc`  
92
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
92
    if ( ( "$i0" != "" ) &  ( "$i1" != "" ) ) then
93
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
93
        nroff -man ${dir}/man/${mode}.0 | sed -ne ${i0},${i1}p
94
    endif
94
    endif
95
    exit 0
95
    exit 0
96
endif
96
endif
97
 
97
 
98
 
98
 
99
exit 0
99
exit 0