Differences From Artifact [9f8955b4e5]:

To Artifact [67aeffb88f]:


10
11
12
13
14
15
16




17
18
19
20
21
22
23
# Copyright (c) P.J.Gawthrop 1996

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$




## Revision 1.12  1998/07/21 08:47:59  peterg
## Default null $2 (regexp) to '^' - ie match any line
##
## Revision 1.11  1998/07/16 20:41:05  peterg
## Now uses new mtt_help
##
## Revision 1.10  1998/05/18 08:35:19  peterg







>
>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (c) P.J.Gawthrop 1996

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.13  2000/04/04 15:22:44  peterg
## Major changes: simple components now work
## Single components now work
##
## Revision 1.12  1998/07/21 08:47:59  peterg
## Default null $2 (regexp) to '^' - ie match any line
##
## Revision 1.11  1998/07/16 20:41:05  peterg
## Now uses new mtt_help
##
## Revision 1.10  1998/05/18 08:35:19  peterg
49
50
51
52
53
54
55

56
57
58
59
60
61
62
# Now browses crs.
#
## Revision 1.1  1996/11/01 12:34:54  peterg
## Initial revision
##
###############################################################


Topic=$1
topic=`echo $Topic | tr "[A-Z]" "[a-z]"`

if [ -n "$2" ]; then
    regexp=$2;
else
    regexp='^';







>







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Now browses crs.
#
## Revision 1.1  1996/11/01 12:34:54  peterg
## Initial revision
##
###############################################################

comment='#';
Topic=$1
topic=`echo $Topic | tr "[A-Z]" "[a-z]"`

if [ -n "$2" ]; then
    regexp=$2;
else
    regexp='^';
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
    find_path="$MTT_COMPONENTS/simple"
    name=''
    sort='sort -u'
    blurb="simple components";;

  crs) 
    key=$summary 
    find_path=$MTT_CRS
    name='*.cr'
    sort='sort -u'
    blurb="constitutive relationships";;

  examples) 
    key=$summary 
    find_path=$MTT_EXAMPLES







|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    find_path="$MTT_COMPONENTS/simple"
    name=''
    sort='sort -u'
    blurb="simple components";;

  crs) 
    key=$summary 
    find_path=$MTT_CRS/r
    name='*.cr'
    sort='sort -u'
    blurb="constitutive relationships";;

  examples) 
    key=$summary 
    find_path=$MTT_EXAMPLES
132
133
134
135
136
137
138

139
140
141
142









143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161

162


163
164
165
166
167
168
169

subtopic=$2
if [ "$subtopic" = "" ]; then
  subtopic='.'
fi;



  if [  "$topic" = "representations" ]; then
    echo $blurb
    mtt2reps_txt
  else









    fullnames=`mtt_find $find_path "$name" | awk '{printf("%s/%s\n",$1,$2)}'`
    N=`echo $fullnames | wc -w`;
    if [ -z "$fullnames" ]; then
	echo No $blurb found.
    else
    echo $N $blurb found.
    for fullname in $fullnames; do
        name=`basename $fullname`
	if [ -n "$other" ]; then
	cat $fullname | egrep $key 
	else
        info=`cat $fullname | egrep $key | awk '{for (i=2;i<=NF;i++) print $i}'`
	category=`echo $fullname |   sed "s!$find_path/!!" ` 
        category=`dirname $category`
	echo $category $name $info
	fi
    done
    fi
  fi

exit


  awk '{print "cat " $1 "/" $2}'  | sh |\
  egrep $key  | egrep $regexp  |\
  sed "s/$summary[	]*//" |\
  sed "s/$description[	]*/  /" |\
  sed "s/$alias[	]*/  Alias: /" |\
  sed "s!$find_path/!!" |\
  $sort







>
|
|
|
|
>
>
>
>
>
>
>
>
>



|

|












<
>

>
>







137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

176
177
178
179
180
181
182
183
184
185
186

subtopic=$2
if [ "$subtopic" = "" ]; then
  subtopic='.'
fi;


case $topic in
    representations)
         echo $comment $blurb
         mtt2reps_txt

	;;
    crs)
	echo  $comment $blurb
        find $find_path -name "$name" -print |\
        awk '{print "grep", key, $1}' key=$key | sh |\
        sed "s/$key //" | $sort
	;;
    *)
	
    fullnames=`mtt_find $find_path "$name" | awk '{printf("%s/%s\n",$1,$2)}'`
    N=`echo $fullnames | wc -w`;
    if [ -z "$fullnames" ]; then
	echo $comment No $blurb found.
    else
    echo $comment $N $blurb found.
    for fullname in $fullnames; do
        name=`basename $fullname`
	if [ -n "$other" ]; then
	cat $fullname | egrep $key 
	else
        info=`cat $fullname | egrep $key | awk '{for (i=2;i<=NF;i++) print $i}'`
	category=`echo $fullname |   sed "s!$find_path/!!" ` 
        category=`dirname $category`
	echo $category $name $info
	fi
    done
    fi

  esac
exit


  awk '{print "cat " $1 "/" $2}'  | sh |\
  egrep $key  | egrep $regexp  |\
  sed "s/$summary[	]*//" |\
  sed "s/$description[	]*/  /" |\
  sed "s/$alias[	]*/  Alias: /" |\
  sed "s!$find_path/!!" |\
  $sort

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]