File indexing completed on 2024-04-06 12:31:47
0001
0002 CURRENT_SCRAM_PROJECT=$(echo $SCRAMRT_SET | cut -d: -f2)
0003 CURRENT_SRC_AREA=$(echo $CMSSW_RELEASE_BASE)
0004 args=
0005 action=
0006
0007 while [ $
0008 do
0009 case $1 in
0010 --full )
0011 action=full; shift;;
0012 --help )
0013 echo "cmsglimpse [-H <CMSSW_TAG>] [--full] [--help] [glimpse-options] <search term>"
0014 echo ""
0015 echo " -H <CMSSW_TAG> - specify the CMSSW tag for the release you "
0016 echo " would like to search (e.g. 'CMSSW_1_0_0'). "
0017 echo " If you do not specify the -H option it will "
0018 echo " default to the release corresponding to "
0019 echo " your current scram runtime environment. "
0020 echo ""
0021 echo " --full - Print the full path to the source files. The "
0022 echo " default is to print the relative path "
0023 echo " beginning with the CMSSW subsystem. "
0024 echo ""
0025 echo " --help - This help information "
0026 echo ""
0027 echo " [glimpse-options] - any of the glimpse options can also be "
0028 echo " specified, except for -H and --help, which"
0029 echo " are used as described above. "
0030 echo " See 'glimpse --help' for the full list. "
0031 exit
0032 ;;
0033 -H )[ $
0034 CURRENT_SCRAM_PROJECT=$2; shift; shift
0035 CURRENT_SRC_AREA=$(scram --arch $SCRAM_ARCH list -c $CURRENT_SCRAM_PROJECT | awk '{print $3}')
0036 ;;
0037 * ) args="$args $1"; shift;;
0038 esac
0039 done
0040
0041 if [ "$CURRENT_SCRAM_PROJECT" == "" ]
0042 then
0043 echo "No project specified. "
0044 echo "Please eval some scram runtime or use -H option."
0045 exit 1
0046 fi
0047
0048 if [ ! -e $CURRENT_SRC_AREA/.glimpse_full ]
0049 then
0050 CURRENT_SRC_AREA=$CURRENT_SRC_AREA/src
0051 fi
0052 case $action in
0053 full )
0054 if [ ! -e $CURRENT_SRC_AREA/.glimpse_full/.glimpse_index ]
0055 then
0056 echo "Glimpse index not found. Expected it in directory:"
0057 echo " $CURRENT_SRC_AREA/.glimpse_full/"
0058 exit 1
0059 fi
0060 glimpse -H $CURRENT_SRC_AREA/.glimpse_full/ $args
0061 ;;
0062 * )
0063 if [ ! -e $CURRENT_SRC_AREA/.glimpse_index ]
0064 then
0065 echo "Glimpse index not found. Expected it in directory:"
0066 echo " $CURRENT_SRC_AREA"
0067 exit 1
0068 fi
0069 glimpse -H $CURRENT_SRC_AREA $args
0070 ;;
0071 esac