#!/bin/sh
# the next line restarts using scotty -*- tcl -*- \
exec scotty2.1.11 "$0" "$@"

package require Tnm 2.1

##
## Search for MIB definitions using a regular expression.
##

proc search exp {
    mib walk oid 1 {
	set label [mib name $oid]
	if [regexp $exp $label] {
	    puts [format {%-32s %-20s (%s)} $oid $label [mib module $oid]]
	}
    }
}

##
## Check the commandline and start searching.
##

if {$argc != 1} {
    puts stderr "usage: [file tail $argv0] expression"
    exit 1
}

search $argv
exit
