diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-27 14:58:18 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-07 21:14:09 +0200 |
commit | e1e2a53514eab869d9a5543e027647e7ab46abd9 (patch) | |
tree | 3e7656bd26909977cb6cd905eb6d53f550a57095 /scripts | |
parent | Better messages for test-assert failures. (diff) | |
download | calp-e1e2a53514eab869d9a5543e027647e7ab46abd9.tar.gz calp-e1e2a53514eab869d9a5543e027647e7ab46abd9.tar.xz |
Module dependants sort output.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/module-dependants.scm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/module-dependants.scm b/scripts/module-dependants.scm index 3759e115..87c1f40b 100755 --- a/scripts/module-dependants.scm +++ b/scripts/module-dependants.scm @@ -22,6 +22,7 @@ exec $GUILE -e main -s "$0" "$@" (use-modules (hnh util) (hnh util path) (srfi srfi-1) + (srfi srfi-71) (ice-9 ftw) (texinfo string-utils) (module-introspection)) @@ -104,11 +105,16 @@ exec $GUILE -e main -s "$0" "$@" (cons (cdr edge) (hash-ref file-uses (car edge) '())))) edges) - (hash-for-each (lambda (symb files) - (display (center-string (format #f " ~a (~a uses)" symb (length files)) - 80 #\= #\=)) (newline) - (for-each (lambda (file) (format #t "• ~a~%" file)) files)) - symbol-used-by) + (for-each (lambda (pair) + (let ((symb files (car+cdr pair))) + (display (center-string (format #f " ~a (~a uses)" symb (length files)) + 80 #\= #\=)) + (newline) + (for-each (lambda (file) (format #t "• ~a~%" file)) files) + (newline))) + (sort* + (hash-map->list cons symbol-used-by) + string< (compose symbol->string car))) (display (center-string " Unused (except possibly internally) " 80 #\= #\=)) (newline) (for-each (lambda (symb) (format #t "• ~a~%" symb)) |