Mercurial > hg > octave-jordi
changeset 17202:9e613baf431e
profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
* scripts/general/profexplore.m: If called with no args, use data from
`profile ("info")'. Add "quit" alias to "exit" for convenience and
consistency with the top level.
author | Philipp Kutin <philipp.kutin@gmail.com> |
---|---|
date | Sat, 27 Jul 2013 18:48:12 +0200 |
parents | d23fcc227fa9 |
children | efd8963f925f |
files | scripts/general/profexplore.m |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/profexplore.m +++ b/scripts/general/profexplore.m @@ -17,13 +17,15 @@ ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {} profexplore (@var{data}) +## @deftypefn {Function File} {} profexplore () +## @deftypefnx {Function File} {} profexplore (@var{data}) ## Interactively explore hierarchical profiler output. ## ## Assuming @var{data} is the structure with profile data returned by ## @code{profile ("info")}, this command opens an interactive prompt ## that can be used to explore the call-tree. Type @kbd{help} to get a list -## of possible commands. +## of possible commands. If @var{data} is omitted, @code{profile ("info")} +## is called and used in its place. ## @seealso{profile, profshow} ## @end deftypefn @@ -32,7 +34,9 @@ function profexplore (data) - if (nargin != 1) + if (nargin == 0) + data = profile ("info"); + elseif (nargin != 1) print_usage (); endif @@ -78,12 +82,13 @@ cmd = input ("profexplore> ", "s"); option = fix (str2double (cmd)); - if (strcmp (cmd, "exit")) + if (strcmp (cmd, "exit") || strcmp (cmd, "quit")) rv = 0; return; elseif (strcmp (cmd, "help")) printf ("\nCommands for profile explorer:\n\n"); printf ("exit Return to Octave prompt.\n"); + printf ("quit Return to Octave prompt.\n"); printf ("help Display this help message.\n"); printf ("up [N] Go up N levels, where N is an integer. Default is 1.\n"); printf ("N Go down a level into option N.\n");