aboutsummaryrefslogtreecommitdiff
path: root/app/clip.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'app/clip.lisp')
-rw-r--r--app/clip.lisp17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/clip.lisp b/app/clip.lisp
new file mode 100644
index 0000000..922cacc
--- /dev/null
+++ b/app/clip.lisp
@@ -0,0 +1,17 @@
+;;;; clip.lisp
+
+(in-package :oneliners.cli.app)
+
+(defun clip/handler (cmd)
+ (a:if-let (args (cli:command-arguments cmd))
+ (ol::run-item
+ (parse-identifier (first args)) (rest args)
+ :force-clip t)
+ (cli:print-usage-and-exit cmd t)))
+
+(defun clip/command ()
+ (cli:make-command
+ :name "clip"
+ :usage "<IDENTIFIER> [ARG ...]"
+ :description "attempt to copy the oneliner to the clipboard"
+ :handler #'clip/handler))