implement "url" command
This commit is contained in:
10
client.rkt
10
client.rkt
@@ -80,6 +80,16 @@
|
||||
(let ([url (gmi:match-link document-object line)])
|
||||
(get (combine-url/relative current-url (url->string url))))))
|
||||
|
||||
(define/public (url-cmd (link-id #f))
|
||||
(if (null? document-object)
|
||||
(displayln "you need to 'go' somewhere first!")
|
||||
(if link-id
|
||||
(let ([link (gmi:match-link document-object link-id)])
|
||||
(if link
|
||||
(displayln (url->string link))
|
||||
(displayln "no link with that id")))
|
||||
(displayln (url->string current-url)))))
|
||||
|
||||
(define/private (handle-gmi url c-in)
|
||||
(let-values ([(doc) (gmi:parse (port->lines c-in))]
|
||||
[(db-in db-out) (make-pipe #f)])
|
||||
|
Reference in New Issue
Block a user