# HG changeset patch # User Philipp Kutin # Date 1374943692 -7200 # Node ID 9e613baf431ed030b422bd055b1cb27fa1418e8b # Parent d23fcc227fa9925d502f357c4ccda6af91dc808a 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. diff --git a/scripts/general/profexplore.m b/scripts/general/profexplore.m --- a/scripts/general/profexplore.m +++ b/scripts/general/profexplore.m @@ -17,13 +17,15 @@ ## . ## -*- 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");