diff scripts/help/which.m @ 23046:168a18a57fc2

which.m: change output to distinguish between files and directories. * which.m: When input is a file or directory, tell the user which one it is rather than saying all file system objects are files.
author Rik <rik@octave.org>
date Sun, 15 Jan 2017 07:49:46 -0800
parents 3a2b891d0b33
children 092078913d54
line wrap: on
line diff
--- a/scripts/help/which.m	Fri Jan 13 13:00:28 2017 -0800
+++ b/scripts/help/which.m	Sun Jan 15 07:49:46 2017 -0800
@@ -54,8 +54,13 @@
         endif
       else
         if (isempty (m(i).type))
-          printf ("'%s' is the file %s\n",
-                  m(i).name, m(i).file);
+          if (isdir (m(i).file))
+            printf ("'%s' is the directory %s\n",
+                    m(i).name, m(i).file);
+          else
+            printf ("'%s' is the file %s\n",
+                    m(i).name, m(i).file);
+          endif
         else
           printf ("'%s' is a %s from the file %s\n",
                   m(i).name, m(i).type, m(i).file);