Compare commits
2 Commits
4323f759fa
...
6529f4118c
Author | SHA1 | Date | |
---|---|---|---|
6529f4118c | |||
0dc93d369e |
@@ -190,6 +190,7 @@
|
||||
[(and (>= status 10) (<= status 19))
|
||||
(displayln "input requested")
|
||||
(display "? ")
|
||||
(flush-output)
|
||||
|
||||
(get-document
|
||||
(struct-copy
|
||||
|
18
gem300.rkt
Normal file → Executable file
18
gem300.rkt
Normal file → Executable file
@@ -9,6 +9,8 @@
|
||||
(define (repl)
|
||||
(display "G-300 > ")
|
||||
|
||||
(flush-output)
|
||||
|
||||
(with-handlers
|
||||
([(or/c exn:fail:user?
|
||||
;; todo: catch these errors separately and reformat them
|
||||
@@ -18,7 +20,8 @@
|
||||
(λ (exn)
|
||||
(displayln (exn-message exn)))])
|
||||
|
||||
(match (regexp-match #px"(\\w+)\\s*(.*)" (read-line))
|
||||
(match (regexp-match #px"(\\w+)\\s*(.*)"
|
||||
(read-line (current-input-port) 'any))
|
||||
[(or (list _ "go" url)
|
||||
(list _ "g" url))
|
||||
(send client go-cmd url)]
|
||||
@@ -46,7 +49,20 @@
|
||||
(list _ "b" _))
|
||||
(send client back-cmd)]
|
||||
|
||||
[(or (list _ "quit" _)
|
||||
(list _ "q" _ ))
|
||||
(exit)]
|
||||
|
||||
[else
|
||||
(displayln "no such command")]))
|
||||
|
||||
(repl))
|
||||
|
||||
(displayln
|
||||
(string-append "welcome to gem300, a gemini client.\n"
|
||||
"to learn more, type:\n"
|
||||
"'go w6vvn.flounder.online/gem300/tutorial.gmi'"))
|
||||
|
||||
(flush-output)
|
||||
|
||||
(repl)
|
||||
|
Reference in New Issue
Block a user