aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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))))