* whence fix & man page fix
@ 1995-07-10 11:26 Zefram
0 siblings, 0 replies; only message in thread
From: Zefram @ 1995-07-10 11:26 UTC (permalink / raw)
To: Z Shell workers mailing list
-----BEGIN PGP SIGNED MESSAGE-----
The patch below fixes the minor problem in whence's behaviour that if
it found an explicitly hashed command it would generate a message "...
is hashed to ..." even if the -v option was not used. It also fixes
the type/whence/which documentation, which previously didn't mention
the -f option.
-zefram
*** Src/builtin.c.old Mon Jul 10 11:50:58 1995
--- Src/builtin.c Mon Jul 10 12:06:36 1995
***************
*** 3369,3377 ****
chn = (struct cmdnam *)chn->next) {
if (chn->nam && (chn->flags & EXCMD) &&
domatch(chn->nam, com, 0)) {
! if (chn->flags & BUILTIN)
printf("%s is hashed to %s\n", chn->nam,
chn->u.cmd);
else if (v && !csh)
printf("%s is %s/%s\n", chn->nam,
chn->u.name ? *(chn->u.name) : "",
--- 3369,3379 ----
chn = (struct cmdnam *)chn->next) {
if (chn->nam && (chn->flags & EXCMD) &&
domatch(chn->nam, com, 0)) {
! if (v && !csh && (chn->flags & BUILTIN))
printf("%s is hashed to %s\n", chn->nam,
chn->u.cmd);
+ else if(chn->flags & BUILTIN)
+ puts(chn->u.cmd);
else if (v && !csh)
printf("%s is %s/%s\n", chn->nam,
chn->u.name ? *(chn->u.name) : "",
***************
*** 3411,3418 ****
/* Look for builtin or function, if -p was not used. */
if (!ops['p'] && (chn = (Cmdnam) cmdnamtab->getnode(cmdnamtab, *argv)) &&
(chn->flags & (SHFUNC | BUILTIN))) {
! if (chn->flags & EXCMD)
printf("%s is hashed to %s\n", chn->nam, chn->u.cmd);
else if (chn->flags & SHFUNC) {
if (csh || ops['f']) {
showflag = 1;
--- 3413,3422 ----
/* Look for builtin or function, if -p was not used. */
if (!ops['p'] && (chn = (Cmdnam) cmdnamtab->getnode(cmdnamtab, *argv)) &&
(chn->flags & (SHFUNC | BUILTIN))) {
! if (v && !csh && (chn->flags & EXCMD))
printf("%s is hashed to %s\n", chn->nam, chn->u.cmd);
+ else if(chn->flags & EXCMD)
+ puts(chn->u.cmd);
else if (chn->flags & SHFUNC) {
if (csh || ops['f']) {
showflag = 1;
*** Doc/zshbuiltins.1.old Mon Jul 10 12:09:16 1995
--- Doc/zshbuiltins.1 Mon Jul 10 12:19:40 1995
***************
*** 839,845 ****
no effect when the tty is frozen. Without options it reports whether the
terminal is frozen or not.
.TP
! \fBtype\fP
Same as \fBwhence\fP \-\fBv\fP.
.TP
\fBtypeset\fP [ \(+-\fBLRZfilrtuxm [\fIn\fP]] [ \fIname\fP[=\fIvalue\fP] ] ...
--- 839,845 ----
no effect when the tty is frozen. Without options it reports whether the
terminal is frozen or not.
.TP
! \fBtype\fP [ \-\fBfpam\fP ] \fIname\fP ...
Same as \fBwhence\fP \-\fBv\fP.
.TP
\fBtypeset\fP [ \(+-\fBLRZfilrtuxm [\fIn\fP]] [ \fIname\fP[=\fIvalue\fP] ] ...
***************
*** 1020,1031 ****
of a job in the job table.
The exit status from this command is that of the job waited for.
.TP
! \fBwhence\fP [ \-\fBacpvm\fP ] \fIname\fP ...
! For each name, indicate how it would be interpreted if used
! as a command name. The \-\fBv\fP flag produces a more verbose
! report. The \-\fBp\fP flag does a path search for \fIname\fP
! even if it is a shell function, alias, or reserved word.
! The \-\fBc\fP flag prints the results in a csh-like format.
The \-\fBa\fP flag does a search for all occurrences of \fIname\fP
throughout the command path.
With the \-\fBm\fP flag the arguments are taken as patterns (should be
--- 1020,1035 ----
of a job in the job table.
The exit status from this command is that of the job waited for.
.TP
! \fBwhence\fP [ \-\fBvcfpam\fP ] \fIname\fP ...
! For each name, indicate how it would be interpreted if used as a
! command name. The \-\fBv\fP flag produces a more verbose report.
! The \-\fBc\fP flag prints the results in a csh-like format,
! and takes precedence over \-\fBv\fP.
! The \-\fBf\fP flag causes the contents of a shell function to be
! displayed, which would otherwise not happen unless the \-\fBc\fP
! flag were used.
! The \-\fBp\fP flag does a path search for \fIname\fP
! even if it is an alias, reserved word, shell function or builtin.
The \-\fBa\fP flag does a search for all occurrences of \fIname\fP
throughout the command path.
With the \-\fBm\fP flag the arguments are taken as patterns (should be
***************
*** 1032,1037 ****
quoted) and the information is displayed for each command matching one
of these patterns.
.TP
! \fBwhich\fP
Same as \fBwhence \-c\fP.
.RE
--- 1036,1041 ----
quoted) and the information is displayed for each command matching one
of these patterns.
.TP
! \fBwhich\fP [ \-\fBpam\fP ] \fIname\fP ...
Same as \fBwhence \-c\fP.
.RE
-----BEGIN PGP SIGNATURE-----
Version: 2.6.i
iQBVAgUBMAEOU2WJ8JfKi+e9AQG/gQH+KB8CZUK9SG88T78cRJd/40PgKR6Cxw8v
8iS9glYEg27wLM5OzTh5BC6GXajwb+6QBp88RA0S+tGHZUeQ5EX6Jg==
=wDeV
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-07-10 11:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-07-10 11:26 whence fix & man page fix Zefram
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).