aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-23 12:56:47 -0600
committerColin Okay <okay@toyful.space>2022-02-23 12:56:47 -0600
commit5289f41dd5d2790ae94297a9652135d856baf277 (patch)
treeb807af55f594a646c3b445567594b5328e2a4574
parent7f3b1cb6946cff68c9006c2694adac631f12f623 (diff)
changed the variable syntax in the oneliner runner
-rw-r--r--oneliners.api-client.lisp36
-rw-r--r--src/lib.lisp4
2 files changed, 20 insertions, 20 deletions
diff --git a/oneliners.api-client.lisp b/oneliners.api-client.lisp
index 5fcaa92..079f672 100644
--- a/oneliners.api-client.lisp
+++ b/oneliners.api-client.lisp
@@ -5,15 +5,15 @@
(defpackage #:ONELINERS.API-CLIENT
(:use :cl :lazybones-client.shared)
(:export #:*host* #:*body* #:*headers* #:*cookies* #:request-with
- #:GET--ONELINERS
- #:PUT--ONELINER-ENTRY-FLAG
- #:PATCH--ONELINER-ENTRY-EDIT
- #:PUT--ONELINER-ONELINER-LOCKED
- #:POST--ONELINER
- #:POST--INVITE
- #:DELETE--ACCESS-ACCESS
- #:POST--ACCESS
- #:POST--INVITE-REDEEM-CODE))
+ #:GET--ONELINERS
+#:PUT--ONELINER-ENTRY-FLAG
+#:PATCH--ONELINER-ENTRY-EDIT
+#:PUT--ONELINER-ONELINER-LOCKED
+#:POST--ONELINER
+#:POST--INVITE
+#:DELETE--ACCESS-ACCESS
+#:POST--ACCESS
+#:POST--INVITE-REDEEM-CODE))
(in-package :ONELINERS.API-CLIENT)
@@ -67,7 +67,7 @@ COOKIES should be an instance of CL-COOKIE:COOKIE-JAR. Defaults to
Entries. TAGS cannot be empty. Returns a [Search
Result](#search-result) object."
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
- (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
+ (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* "/api"
(FORMAT NIL "/oneliners")
(WHEN (OR TAGS LIMIT NOTFLAGGED)
(LIST "?"
@@ -91,7 +91,7 @@ Result](#search-result) object."
(DEFUN PUT--ONELINER-ENTRY-FLAG (ENTRY &KEY TOKEN VALUE)
"Flag the oneliner for review."
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
- (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
+ (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* "/api"
(FORMAT NIL "/oneliner/~a/flag" ENTRY)
(WHEN (OR TOKEN VALUE)
(LIST "?"
@@ -116,7 +116,7 @@ Result](#search-result) object."
(DEFUN PATCH--ONELINER-ENTRY-EDIT (ENTRY &KEY TOKEN)
"Edit the fields of a oneliner."
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
- (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
+ (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* "/api"
(FORMAT NIL "/oneliner/~a/edit" ENTRY)
(WHEN (OR TOKEN)
(LIST "?"
@@ -137,7 +137,7 @@ Result](#search-result) object."
(DEFUN PUT--ONELINER-ONELINER-LOCKED (ONELINER &KEY TOKEN VALUE)
"Sets the locked value of the specified oneliner"
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
- (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
+ (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* "/api"
(FORMAT NIL "/oneliner/~a/locked" ONELINER)
(WHEN (OR TOKEN VALUE)
(LIST "?"
@@ -162,7 +162,7 @@ Result](#search-result) object."
(DEFUN POST--ONELINER (&KEY TOKEN)
"Make a new [oneliner](#oneliner)."
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
- (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
+ (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* "/api"
(FORMAT NIL "/oneliner")
(WHEN (OR TOKEN)
(LIST "?"
@@ -183,7 +183,7 @@ Result](#search-result) object."
(DEFUN POST--INVITE (&KEY TOKEN)
"On success, return an object containing a new [invite token](#invite-token)."
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
- (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
+ (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* "/api"
(FORMAT NIL "/invite")
(WHEN (OR TOKEN)
(LIST "?"
@@ -204,7 +204,7 @@ Result](#search-result) object."
(DEFUN DELETE--ACCESS-ACCESS (ACCESS &KEY TOKEN)
"Revoke access of CONTRIBUTOR"
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
- (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
+ (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* "/api"
(FORMAT NIL "/access/~a" ACCESS)
(WHEN (OR TOKEN)
(LIST "?"
@@ -220,7 +220,7 @@ Result](#search-result) object."
(DEFUN POST--ACCESS ()
"Authenticate a contributor and reply with an [API token](#access-token)"
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
- (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
+ (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* "/api"
(FORMAT NIL "/access") NIL)))
(IF LAZYBONES-CLIENT.SHARED:*BODY*
(DEXADOR:POST LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT
@@ -235,7 +235,7 @@ Result](#search-result) object."
(DEFUN POST--INVITE-REDEEM-CODE (CODE)
"Redeem an [invite code](#invite-code) and create a new [contributor](#new-contributor-post-body)"
(LET ((LAZYBONES-CLIENT.SHARED::REQ-STRING
- (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST*
+ (APPLY #'CONCATENATE 'STRING LAZYBONES-CLIENT.SHARED:*HOST* "/api"
(FORMAT NIL "/invite/redeem/~a" CODE) NIL)))
(IF LAZYBONES-CLIENT.SHARED:*BODY*
(DEXADOR:POST LAZYBONES-CLIENT.SHARED::REQ-STRING :CONTENT
diff --git a/src/lib.lisp b/src/lib.lisp
index 680e93a..f596c84 100644
--- a/src/lib.lisp
+++ b/src/lib.lisp
@@ -176,13 +176,13 @@ the directories that appear in the value of that variable."
(defun collect-positional-arguments (oneliner)
(remove-duplicates
(sort
- (ppcre:all-matches-as-strings "\\$[1-9][0-9]*" oneliner)
+ (ppcre:all-matches-as-strings "#[1-9][0-9]*" oneliner)
#'string<)
:test #'equal))
(defun collect-named-arguments (oneliner)
(remove-duplicates
- (ppcre:all-matches-as-strings "\\$[a-zA-Z_][a-zA-Z0-9_]*" oneliner)
+ (ppcre:all-matches-as-strings "#[A-Z_][A-Z0-9_]*" oneliner)
:test #'equal))
(defun handle-run-oneliner (ol &optional clip)