From 2dd1e60e52cb7871467b1aade5c74c6bdd21b3aa Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Mon, 21 Feb 2022 15:54:54 -0600 Subject: added flagging and locking commands --- build-app.lisp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'build-app.lisp') diff --git a/build-app.lisp b/build-app.lisp index 5d4f069..c95d163 100644 --- a/build-app.lisp +++ b/build-app.lisp @@ -56,10 +56,18 @@ my1337pw.") (flag :long-name "add" :description "Intaractively add a oneliner and update the wiki.") (flag :long-name "update" - :description "Interactively edit a oneliner and update the wiki.")) + :description "Interactively edit a oneliner and update the wiki.") + (flag :long-name "flag" + :description "Flag a oneliner for review.") + (flag :long-name "unflag" + :description "If you have admin priviliges, unflag a oneliner.") + (flag :long-name "lock" + :description "If you have admin priviliges, lock a oneliner from being edited.") + (flag :long-name "unlock" + :description "If you have admin priviliges, unlock a oneliner.")) (group (:header "Access" :hidden t) (flag :long-name "login" - :description "Attempt to login to your contributor account. ARGS are interpreted as USERNAME PASSWORD. Success will return ab API token, writing it automatically into your config file.") + :description "Attempt to login to your contributor account. ARGS are interpreted as USERNAME PASSWORD.") (flag :long-name "revoke" :description "Revoke your own access token.")) (group (:header "Invites" :hidden t) @@ -117,10 +125,18 @@ than the users." (arguments ;; when the first argument is a number, try run a oneliner (a:when-let (hist-number (parse-integer (first arguments) :junk-allowed t)) - (if (getopt :long-name "flag") - (format t "TBD: going to flag a command~%") ;(cli::flag-item hist-number) - (format t "TBD: Going to run command ~a with arguments ~a~%" - hist-number (rest arguments))) + (cond + ((getopt :long-name "flag") + (cli::flag-item hist-number)) + ((getopt :long-name "unflag") + (cli::unflag-item hist-number)) + ((getopt :long-name "lock") + (cli::lock-item hist-number)) + ((getopt :long-name "unlock") + (cli::unlock-item hist-number)) + (t + (format t "TBD: Going to run command ~a with arguments ~a~%" + hist-number (rest arguments)))) (uiop:quit)) ;; otherwise search for oneliners (cli::search-for-oneliners arguments -- cgit v1.2.3