diff libinterp/corefcn/sysdep.cc @ 20059:cf9b94a89620

Document get_home_directory in Octave manual and NEWS file. * NEWS: Add get_home_directory to list of new functions. * system.txi: Add get_home_directory to manual. * sysdep.cc(Fget_home_directory): Use preferred docstring format of single line summary sentence followed by second paragragh of explanation. Add BIST test.
author Rik <rik@octave.org>
date Thu, 02 Apr 2015 15:36:38 -0700
parents 47d420d769ba
children ab7582167810
line wrap: on
line diff
--- a/libinterp/corefcn/sysdep.cc	Thu Apr 02 14:21:43 2015 -0700
+++ b/libinterp/corefcn/sysdep.cc	Thu Apr 02 15:36:38 2015 -0700
@@ -1011,10 +1011,12 @@
 
 DEFUN (get_home_directory, , ,
        "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} get_home_directory ()\n\
-Return the current home directory.  On most systems, this is equivalent\n\
-to @code{getenv (\"HOME\")}.  On Windows systems, if @env{HOME} is not\n\
-set in the environment, it is equivalent to\n\
+@deftypefn {Built-in Function} {@var{homedir} =} get_home_directory ()\n\
+Return the current home directory.\n\
+\n\
+On most systems, this is equivalent to @code{getenv (\"HOME\")}.  On Windows\n\
+systems, if the environment variable @env{HOME} is not set then it is\n\
+equivalent to\n\
 @code{fullfile (getenv (\"HOMEDRIVE\"), getenv (\"HOMEPATH\"))}\n\
 @seealso{getenv}\n\
 @end deftypefn")
@@ -1022,6 +1024,13 @@
   return octave_value (octave_env::get_home_directory ());
 }
 
+/*
+%!test
+%! if (! ispc ())
+%!   assert (get_home_directory (), getenv ("HOME")); 
+%! endif
+*/
+
 // This function really belongs in display.cc, but including defun.h in
 // that file results in conflicts with symbols from headers that are
 // needed for X11 and Carbon functions.