aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-17 10:44:03 -0600
committerColin Okay <okay@toyful.space>2022-02-17 10:44:03 -0600
commit9844f6ae2512e7da6910e51c2d0d0f7da1550663 (patch)
treed99cc504cb23cc98318abef3048a4ad7e657a54a /src
parent1d59c9675341b1e962f9c79e1fd1b5ce52cd9cbf (diff)
about to dump unix-opt in favor of clon
Diffstat (limited to 'src')
-rw-r--r--src/main.lisp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/main.lisp b/src/main.lisp
index 6c64ce2..0b33a6e 100644
--- a/src/main.lisp
+++ b/src/main.lisp
@@ -1,7 +1,8 @@
;;;; main.lisp -- oneliners.cli entrypoint
(defpackage oneliners.cli
- (:use :cl))
+ (:use :cl)
+ (:local-nicknames (#:api #:oneliners.api-client)))
(in-package :oneliners.cli)
;;; CLI OPTIONS
@@ -30,10 +31,7 @@
:arg-parser #'parse-integer)
(:name :not-flagged
:description "Filter flagged oneliners from the search results"
- :long "not-flagged")
- (:name :audited-only
- :description "Filter unaudited oneliners from the search results"
- :long "audited-only"))
+ :long "not-flagged"))
(defparameter +help-suffix+
"Unless RESULT is an integer, search for oneliners that involve each command in COMMANDS.
@@ -61,7 +59,7 @@ E.g.
(defun last-search-file ()
(merge-pathnames ".last_oneliners_search" (user-homedir-pathname)))
-;;; UTILITIES
+;;; RUNNING COMMANDS
(defun parent-process-name ()
"Prints the name of the parent process of the current process."
@@ -104,3 +102,16 @@ printed to OUTPUT-STREAM. "
(loop while (listen shell-output)
do (princ (read-line shell-output) output-stream)
(terpri output-stream))))))
+
+;;; main
+
+(defun main ()
+ (handler-case
+ (multiple-value-bind (options free-args) (opts:get-opts)
+ (print (list :options options :free-args free-args))
+ (terpri)
+ (uiop:quit))
+ (unix-opts:unknown-option (err)
+ (declare (ignore err))
+ (princ (help-text))
+ (terpri))))