s command to show a link url - clic - Clic is an command line interactive client for gopher written in Common LISP HTML git clone git://bitreich.org/clic/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/clic/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 8e4fb9b8579b02bd71c70cc83492ce2a39f18f54 DIR parent ff02e48463d32a5173dcc55327a4adc9435ee3d5 HTML Author: Solene Rapenne <solene@perso.pw> Date: Thu, 24 May 2018 16:04:22 +0200 s command to show a link url Diffstat: M README.md | 1 + M clic.1 | 7 ++----- M clic.lisp | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) --- DIR diff --git a/README.md b/README.md @@ -51,6 +51,7 @@ Keyboard bindings + h : display history + r : reload the page + x or q or ^D : quit ++ sNUMBER : show the gopher url for link $number + / pattern : redisplay the menu only with lines containing string (no regex) + d : display the raw response DIR diff --git a/clic.1 b/clic.1 @@ -30,11 +30,8 @@ Go to previous page. .B h Display the history. .TP -.B b or - -Display the bookmarks and choose a link from it. -.TP -.B a or + -Add a bookmark. +.B sNUMBER +Show the url of link $NUMBER .TP .B d Dump raw item information. DIR diff --git a/clic.lisp b/clic.lisp @@ -361,11 +361,26 @@ (when (<= 1 (length *history*)) (visit (pop *history*)))) +(defun s(number) + "show url for the link $NUMBER" + (let ((destination (gethash number *links*))) + (if (not destination) + (format t "No link ~a~%" number) + (format t "gopher://~a~a/~a~a~%" + (location-host destination) + (let ((port (location-port destination))) + (if (= 70 port) + "" + (format nil ":~a" port))) + (location-type destination) + (location-uri destination))))) + (defun help-shell() "show help for the shell" (format t "number : go to link n~%") (format t "p or / : go to previous page~%") (format t "h : display history~%") + (format t "sNUMBER : show url for link $NUMBER~%") (format t "r or * : reload the page~%") (format t "help : show this help~%") (format t "d : dump the raw reponse~%") @@ -425,6 +440,9 @@ ((string= "help" input) (help-shell)) + ((search "s" input) + (s (parse-integer (subseq input 1)))) + ((or (string= "*" input) (string= "ls" input)