( ESNUG 406 Item 2 ) -------------------------------------------- [02/12/03]
Subject: ( ESNUG 291 #6 ) Steve's Lazy Man (lman) Generic Man Page Script
> Recently I had the problem that I didn't know exactly what Synopsys
> synthesis command to use. For UNIX commands one could find something
> with the "apropos" command. I have a paper version of the synthesis
> quick reference available, but I thought there must be another way. I
> wrote together a few lines of Perl code (see below) and what I got was
> a kind of "apropos" command for the Synopsys synthesis commands:
> "synapropos". It extracts data from the Synopsys man pages and I think
> it might be useful for many other Synopsys users.
>
> - Peter Kamphuis
> Siemens Semiconductor Group Munich, Germany
From: Steve Ehlers <director=steve.ehlers choir=conexant clot prom>
Hi, John,
I have long enjoyed the use of both Synman (ESNUG 188 #2) and Synapropos
(ESNUG 291 #6) for finding and viewing man pages. Thank you, Larry Fiedler
and Peter Kamphuis. I have two things to offer in return.
As a tidbit, the following bash function allows one to get the man page for
Synopsys warnings like so:
warnman UIO-12
# Find man pages for Synopsys warning messages, e.g.
# "warnman OPT-318"
warnman() {
msg=`echo $1 | perl -pe 's,(.*)-(.*),$1/$1-$2,;'`
less $SYNOPSYS/doc/syn/man/catn/$msg.n
}
Or for the csh folks:
alias warnman 'set msg=`echo \!* | \
perl -pe "s,(.*)-(.*),\1/\1-\2,;"` \
&& less $SYNOPSYS/doc/syn/man/catn/$msg.n'
A bit more involved is the attached Perl script. I've been using Verplex
and had made vman a la "Synman":
alias vman='man -M $VERPLEX_HOME/doc'
But I found it annoying to have to exactly remember the full command and
type "vman report_black_box" for a command that could be abbreviated as
"rep bl b" in the Verplex command shell. Why couldn't "vman rep bl b" work?
So I wrote a Perl script to do that.
Then I realized it could work given *any* man pages path. So now I have
these bash aliases:
alias ptman='lman -M $SYNOPSYS/doc/pt/man'
alias sman='lman -M $SYNOPSYS/doc/snps_tcl/man:$SYNOPSYS/doc/syn/man'
alias vman='lman -M $VERPLEX_HOME/doc'
I can type "sman ins te ma" instead of
"synman insert_test_map_effort_enabled".
Or type "ptman set c" to get a list of all documented PrimeTime commands
that start with "set_c", and then pick from the list. If I'm really
fishing, "vman -l point" will return a list of all Verplex man pages with
"point" anywhere in the command name. It's kind of slow, but by default
lman even searches using the $MANPATH environment variable for system
commands! Type "lman -h" for a help message.
I call it lman, as in Lazy Man. Of course, that's man as in the command,
not me, really. Well, okay, so maybe it's both, but I'm only trying to
live up to one of "the three principal virtues" from the Perl man page!
- Steve Ehlers
Conexant Austin, TX
[ Editor's Note: Steve's script is #38 of DeepChip Downloads - John ]
|
|