Extension to "help"?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Extension to "help"?

Ted.Harding
I'd like to suggest a useful extension to octave's "help".

Namely

  help dirname

would list all the .m files in directory dirname, presumed to be in the
octave search path (or in all directories with that name in the serach
path).

If you do just "help" you get all .m files, anywhere. If you try, say,
"help control" you get nothing. It would be useful to (in this case)
find all the .m files for "control". This would be especially useful
for directories where the user may have stored his own .m files -- one
sometimes forgets what one may have written in the past!

One can think of various forms for the syntax. E.g.

   help dirname               all files IN dirname
   help dirname//             all files IN/UNDER dirname
   help dir1/dir2             so you only get the dir2 which is under dir1
                              (as opposed to help dir2 which would find
                              all instances of dir2).

Best wishes,
Ted.                                    ([hidden email])

Reply | Threaded
Open this post in threaded view
|

Extension to "help"?

John W. Eaton-6
On 28-Feb-1997, Ted Harding <[hidden email]> wrote:

| I'd like to suggest a useful extension to octave's "help".

This was already in the PROJECTS file:

  * As the number of m-files with octave grows perhaps a 'Contents.m'
    file for each toolbox (directory) would be appropriate so one
    knows exactly what functions are in a toolbox with a quick look.
    It would be best to generate information for each function directly
    from the M-files, so that the information doesn't have to be
    duplicated, and will remain current if the M-files change.  It
    would also be best to do as much of this as possible in an M-file,
    though I wouldn't mind adding some basic support for listing the
    names of all the directories in the LOADPATH, and the names of all
    the M-files in a given directory if that is needed.

I've added the following text to this item:

    Also make it possible to recursively search for Contents files:

      help dir        -- Contents from dir
      help dir//      -- Contents from dir and all its subdirectories
      help dir1/dir2  -- Contents from dir2 which is under dir1

Thanks,

jwe

Reply | Threaded
Open this post in threaded view
|

Re: Extension to "help"?

Mark Odegard
In reply to this post by Ted.Harding


>
> | I'd like to suggest a useful extension to octave's "help".
>
> This was already in the PROJECTS file:
>
>   * As the number of m-files with octave grows perhaps a 'Contents.m'
>     file for each toolbox (directory) would be appropriate so one
>     knows exactly what functions are in a toolbox with a quick look.
>     It would be best to generate information for each function directly
>     from the M-files, so that the information doesn't have to be
>     duplicated, and will remain current if the M-files change.  It
>     would also be best to do as much of this as possible in an M-file,
>     though I wouldn't mind adding some basic support for listing the
>     names of all the directories in the LOADPATH, and the names of all
>     the M-files in a given directory if that is needed.
>
> I've added the following text to this item:
>
>     Also make it possible to recursively search for Contents files:
>
>       help dir        -- Contents from dir
>       help dir//      -- Contents from dir and all its subdirectories
>       help dir1/dir2  -- Contents from dir2 which is under dir1
>
> Thanks,
>
> jwe
>

I use the following script to extract line(s) from the m-file into
a contents file in a given m-file directory
 
/bin/rm -f Contents.m
grep -h "^%[A-Z-]" *.m > Contents.m
 
With, for example, the following file in directory plots

{107} more AAAAAA.m
%Plotting Functions

You, of course, only want to have one line beginning with

%{Capital_Letter}other stuff

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mark Odegard, Potential Fields Coordinator| [hidden email]
Unocal Corporation, E & P Technology      | Telno: (281)287-7666
14141 Southwest Freeway                   | Fax:   (281)287-5376
Sugar Land, TX 77478, USA                 | "The Standard Disclaimers!"
>>>>>>>>>>>>> "No man is truly free who has to work for a living" <<<<<<<<<<<