if the per-function output is sorted by ascending total time
if a summary of the per-function total time is shown at the end
if we attempt to use rich to highlight the CLI output.
These options can also be controlled from the CLI using new arguments:
parser.add_argument(
'-r',
'--rich',
action='store_true',
help='Use rich formatting',
)
parser.add_argument(
'-t',
'--sort',
action='store_true',
help='Sort by ascending total time',
)
parser.add_argument(
'-m',
'--summarize',
action='store_true',
help='Print a summary of total function time',
)
The output is pretty:
This builds on an older PR: https://github.com/pyutils/line_profiler/pull/221 I ninja merged that adds the summary and sorting features to the show_text function (and also fixes column formatting issues), but this PR exposes them to the user. As such - because this hasn't been released, new code introduced in that PR is subject to discussion and change here.
Looking for feedback on the UX here:
Are these good names for the CLI flags?
Should we support more sorting orders other than the default (which is based on function name - and IMO kinda weird) and ascending time?
Factored the rich output features out of https://github.com/pyutils/line_profiler/pull/222 into its own PR.
Adds several options to
show_text
to control:These options can also be controlled from the CLI using new arguments:
The output is pretty:
This builds on an older PR: https://github.com/pyutils/line_profiler/pull/221 I ninja merged that adds the summary and sorting features to the
show_text
function (and also fixes column formatting issues), but this PR exposes them to the user. As such - because this hasn't been released, new code introduced in that PR is subject to discussion and change here.Looking for feedback on the UX here:
Notes: