From d6dee4eb2906b1a845488065066fae7ef6906338 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Tue, 22 Feb 2022 11:39:42 -0600 Subject: supporting forced clipping. defaulting to bash --- src/lib.lisp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib.lisp b/src/lib.lisp index 442e023..0ea4cda 100644 --- a/src/lib.lisp +++ b/src/lib.lisp @@ -152,8 +152,8 @@ the directories that appear in the value of that variable." (ppcre:all-matches-as-strings "\\$[a-zA-Z_][a-zA-Z0-9_]*" oneliner) :test #'equal)) -(defun handle-run-oneliner (ol &key (runstyle "auto")) - (if (equalp runstyle "manual") +(defun handle-run-oneliner (ol &optional clip) + (if clip (progn (trivial-clipboard:text ol) (format t "Copied oneliner to clipboard~%")) (progn @@ -163,7 +163,7 @@ the directories that appear in the value of that variable." (run-with-shell ol :shell-name (or (get-shell) "bash"))))) -(defun run-item (item-number args) +(defun run-item (item-number args &optional force-clip) (with-cached-result (ol item-number) (let* ((oneliner (getf ol :oneliner)) (runstyle (getf ol :runstyle)) @@ -186,7 +186,7 @@ the directories that appear in the value of that variable." do (setf oneliner (str:replace-all var (second bound) oneliner))) - (handle-run-oneliner oneliner :runstyle runstyle))))) + (handle-run-oneliner oneliner (or force-clip (equalp runstyle "manual"))))))) (defun add-new-oneliner () -- cgit v1.2.3