From e955869d2868a8cf867db44aad53534a92e10b92 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Tue, 9 Aug 2022 10:07:05 -0500 Subject: [change] the printout of ol show; [remove] uneeded stuff --- app/util.lisp | 3 ++- build-app.lisp | 24 ------------------------ lib/client.lisp | 8 +++++++- 3 files changed, 9 insertions(+), 26 deletions(-) delete mode 100644 build-app.lisp diff --git a/app/util.lisp b/app/util.lisp index 6bcf577..b657e51 100644 --- a/app/util.lisp +++ b/app/util.lisp @@ -34,5 +34,6 @@ command. (handler-case (destructuring-bind ,args-pattern (clingon:command-arguments *cmd*) ,@body) - (error () + (#+sbcl sb-kernel::arg-count-error + #+ccl ccl::simple-program-error (e) (clingon:print-usage *cmd* t))))))) diff --git a/build-app.lisp b/build-app.lisp deleted file mode 100644 index 2a6abab..0000000 --- a/build-app.lisp +++ /dev/null @@ -1,24 +0,0 @@ -;;; build-app.lisp -- Contains the command line frontend definition -;;; to build the cli, simply load this file from the command line. - -;; Copyright (C) 2022 Colin Okay - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU Affero General Public License as -;; published by the Free Software Foundation, either version 3 of the -;; License, or (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU Affero General Public License for more details. - -;; You should have received a copy of the GNU Affero General Public License -;; along with this program. If not, see . - - -(asdf:load-system "oneliners.cli/app") -(in-package :oneliners.cli.app) -;;; DUMP EXECUTABLE -(dump "ol" main) ; from clon - diff --git a/lib/client.lisp b/lib/client.lisp index 9f92c6e..680d07b 100644 --- a/lib/client.lisp +++ b/lib/client.lisp @@ -79,7 +79,13 @@ running the body. If such a oneliner can be found." (when-oneliner (ol name-or-number) (print-oneliner-result-for-user ol) (when (oneliner-explanation ol) - (princ #\newline) + (loop repeat (floor (/ *term-width* 3)) do (princ " ")) + (let ((tilde-count + (floor (* 0.5 (- (/ *term-width* 3) (length "NOTES")))))) + (loop repeat tilde-count do (princ "~")) + (princ "NOTES") + (loop repeat tilde-count do (princ "~"))) + (terpri) (princ (oneliner-explanation ol))))) (defun print-drafts () -- cgit v1.2.3