diff options
author | Colin Okay <okay@toyful.space> | 2022-02-17 16:58:47 -0600 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2022-02-17 16:58:47 -0600 |
commit | e609343a4694b0f88de730e0a31fe1fcc262f372 (patch) | |
tree | c287393c102b114e928e5fc260703fc871b8b099 /build-app.lisp | |
parent | ef3741726fcda3962e29110d49b4105a2ac40e50 (diff) |
basic cli skeleton
Diffstat (limited to 'build-app.lisp')
-rw-r--r-- | build-app.lisp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/build-app.lisp b/build-app.lisp index c5a6f25..48222cd 100644 --- a/build-app.lisp +++ b/build-app.lisp @@ -5,8 +5,42 @@ (in-package :oneliners.cli.app) -(defsynopsis (:postfix "ARGS ...") +(defsynopsis (:postfix "TERMS ... | N ARGS ...") (text :contents "This is some arbitrary text.") - (group (:header "Group 1"))) + (group (:header "Search") + (lispobj :long-name "count" :short-name "n" + :argument-type :optional + :default-value 10 + :typespec 'integer) + (flag :long-name "not-flagged" + :description "Request that no flagged oneliners are returned.")) + (group () + (flag :long-name "help" :short-name "h" + :description "print this help menu."))) + + +(defun main () + "Entry point for our standalone application." + (make-context) + (when (getopt :short-name "h") + (help) + (uiop:quit)) + (let ((arguments (remainder))) + + (unless arguments + (help) + (uiop:quit)) + + (alexandria:when-let (hist-number (parse-integer (first arguments) :junk-allowed t)) + (format t "TBD: Going to run command ~a with arguments ~a~%" + hist-number (rest arguments)) + (uiop:quit)) + + (format t "TBD: Going to search for commands mentioning the terms ~a~%" arguments)) + + (uiop:quit)) + + +(dump "ol" main) |