aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/client.lisp19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/client.lisp b/lib/client.lisp
index 39d60ec..9f34bb5 100644
--- a/lib/client.lisp
+++ b/lib/client.lisp
@@ -92,14 +92,14 @@ running the body. If such a oneliner can be found."
(defvar *ol-output-timeout* 1)
-(defun run-item (ident args &key force-clip (timeout nil timeout-p) draftp)
+(defun run-item (ident args &key force-clip (timeout nil timeout-p) draftp verbose)
"Runs a oneliner identified by IDENT (if available) with arguments ARGS."
(let ((ol (if draftp (fetch-draft ident) (the-oneliner ident))))
(when ol
(let ((*ol-output-timeout* (if timeout-p timeout *ol-output-timeout*)))
- (bind-vars-and-run-oneliner ol args force-clip)))))
+ (bind-vars-and-run-oneliner ol args force-clip verbose)))))
-(defun bind-vars-and-run-oneliner (ol args &optional force-clip)
+(defun bind-vars-and-run-oneliner (ol args &optional force-clip verbose)
(let* ((oneliner (oneliner-oneliner ol))
(runstyle (oneliner-runstyle ol))
(pos-args (get-positional-arguments ol))
@@ -120,17 +120,18 @@ running the body. If such a oneliner can be found."
do (setf oneliner
(str:replace-all var (second bound) oneliner)))
- (handle-run-oneliner oneliner (or force-clip (equalp runstyle "manual"))))))
+ (handle-run-oneliner oneliner (or force-clip (equalp runstyle "manual")) verbose))))
-(defun handle-run-oneliner (ol &optional clip)
+(defun handle-run-oneliner (ol &optional clip (verbose t))
(if clip
(progn (trivial-clipboard:text ol)
(format t "Copied oneliner to clipboard~%"))
(progn
- (format t "Attempting to run:~%")
- (princ ol)
- (princ #\newline)
- (princ #\newline)
+ (when verbose
+ (format t "Attempting to run:~%")
+ (princ ol)
+ (princ #\newline)
+ (princ #\newline))
(run-with-shell ol :shell-name (or (shell) "bash") :await-output-p *ol-output-timeout*))))
;;; ADDING ONELINERS