zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <A.Main@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu (Z Shell workers mailing list)
Subject: whence fix & man page fix
Date: Mon, 10 Jul 1995 12:26:59 +0100 (BST)	[thread overview]
Message-ID: <2940.199507101127@stone.dcs.warwick.ac.uk> (raw)

-----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-----


                 reply	other threads:[~1995-07-10 11:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2940.199507101127@stone.dcs.warwick.ac.uk \
    --to=a.main@dcs.warwick.ac.uk \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).