diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-04-23 19:26:54 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-04-23 19:26:54 +0200 |
commit | 34da56150cbee6449faec22faabf6b2af3c84ed9 (patch) | |
tree | c263ef8ab6e77fb822db9bac8b7d78dd683f8750 /module/output/general.scm | |
parent | Add command line option parsing. (diff) | |
download | calp-34da56150cbee6449faec22faabf6b2af3c84ed9.tar.gz calp-34da56150cbee6449faec22faabf6b2af3c84ed9.tar.xz |
Move stuff from main.
Diffstat (limited to '')
-rw-r--r-- | module/output/general.scm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/module/output/general.scm b/module/output/general.scm new file mode 100644 index 00000000..f455f18b --- /dev/null +++ b/module/output/general.scm @@ -0,0 +1,10 @@ +(define-module (output general) + ) + +(define-public (trim-to-width str len) + (let ((trimmed (string-pad-right str len))) + (if (< (string-length trimmed) + (string-length str)) + (string-append (string-drop-right trimmed 1) + "…") + trimmed))) |