diff scripts/help/which.m @ 8672:2a49c32d4322

allow help to work with files containing only comments
author John W. Eaton <jwe@octave.org>
date Wed, 04 Feb 2009 17:06:32 -0500
parents f134925a1cfa
children 5dd06f19e9be
line wrap: on
line diff
--- a/scripts/help/which.m	Wed Feb 04 15:53:24 2009 -0500
+++ b/scripts/help/which.m	Wed Feb 04 17:06:32 2009 -0500
@@ -31,11 +31,18 @@
     if (nargout == 0)
       for i = 1:nargin
 	if (isempty (m(i).file))
-	  printf ("`%s' is a %s function\n",
-		  m(i).name, m(i).type);
+	  if (! isempty (m(i).type))
+	    printf ("`%s' is a %s function\n",
+		    m(i).name, m(i).type);
+	  endif
 	else
-	  printf ("`%s' is a %s from the file %s\n",
-		  m(i).name, m(i).type, m(i).file);
+	  if (isempty (m(i).type))
+	    printf ("`%s' is the file %s\n",
+		    m(i).name, m(i).file);
+	  else
+	    printf ("`%s' is a %s from the file %s\n",
+		    m(i).name, m(i).type, m(i).file);
+	  endif
 	endif
       endfor
     else