From e1e2a53514eab869d9a5543e027647e7ab46abd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 27 Jun 2022 14:58:18 +0200 Subject: Module dependants sort output. --- scripts/module-dependants.scm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'scripts') 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)) -- cgit v1.2.3