aboutsummaryrefslogtreecommitdiff
path: root/app/clip.lisp
blob: 922cacce69d6775123ebbb1c94616dc11a5912c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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))