Index: mttroot/mtt/bin/mtt_help ================================================================== --- mttroot/mtt/bin/mtt_help +++ mttroot/mtt/bin/mtt_help @@ -12,10 +12,14 @@ ############################################################### ## 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 @@ -51,10 +55,11 @@ ## 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; @@ -97,11 +102,11 @@ sort='sort -u' blurb="simple components";; crs) key=$summary - find_path=$MTT_CRS + find_path=$MTT_CRS/r name='*.cr' sort='sort -u' blurb="constitutive relationships";; examples) @@ -134,20 +139,30 @@ if [ "$subtopic" = "" ]; then subtopic='.' fi; - if [ "$topic" = "representations" ]; then - echo $blurb - mtt2reps_txt - else +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 No $blurb found. + echo $comment No $blurb found. else - echo $N $blurb found. + echo $comment $N $blurb found. for fullname in $fullnames; do name=`basename $fullname` if [ -n "$other" ]; then cat $fullname | egrep $key else @@ -156,12 +171,14 @@ category=`dirname $category` echo $category $name $info fi done fi - fi + esac exit + + awk '{print "cat " $1 "/" $2}' | sh |\ egrep $key | egrep $regexp |\ sed "s/$summary[ ]*//" |\ sed "s/$description[ ]*/ /" |\ sed "s/$alias[ ]*/ Alias: /" |\