Added size-sort options to scripts/code.py

Now with -s/--sort and -S/--reverse-sort for sorting the functions by
size.

You may wonder why add reverse-sort, since its utility doesn't seem
worth the cost to implement (these are just helper scripts after all),
the reason is that reverse-sort is quite useful on the command-line,
where scrollback may be truncated, and you only care about the larger
entries.

Outside of the command-line, normal sort is prefered.

Fortunately the difference is just the sign in the sort key.

Note this conflicts with the short --summary flag, so that has been
removed.
This commit is contained in:
Christopher Haster
2022-02-18 23:51:52 -06:00
parent ead50807f1
commit b045436c23
5 changed files with 33 additions and 14 deletions

View File

@@ -75,7 +75,7 @@ tags:
.PHONY: code
code: $(OBJ)
./scripts/code.py $^ $(CODEFLAGS)
./scripts/code.py -S $^ $(CODEFLAGS)
.PHONY: test
test: