gem.awk

A gemini client in POSIX awk
git clone git://git.vgx.fr/gem.awk
Log | Files | Refs

commit e1238b7caf608155af9387b6b7f64af85adfe3ca
parent 5fc081152a9251dbe3b73bd0b09725734b16b771
Author: Léo Villeveygoux <l@vgx.fr>
Date:   Sun, 14 Jun 2020 02:16:37 +0200

Add current page redirects

Diffstat:
Mgem.awk | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/gem.awk b/gem.awk @@ -178,6 +178,8 @@ function help() { print " \033[3;4mn\033[0m : follow link \033[3;4mn\033[0m of current text/gemini page" print " . : reload current page" print " .. : go to parent" + print " | \033[3;4mcmd\033[0m : redirect current page to \033[3;4mcmd\033[0m (new connexion)" + print " > \033[3;4mfile\033[0m : redirect current page to \033[3;4mfile\033[0m (new connexion)" print " toc : list titles in a text/gemini page" print " links : list URLs linked in a text/gemini page" print " history [\033[3;4mN\033[0m] : list URLs of visited pages, or open \033[3;4mN\033[0mth visited page" @@ -220,6 +222,14 @@ $1 ~ /^[[:digit:]]+$/ { print "No current page." } +/^[|>]/ { + if (CURRENT_URL) { + plumb_out(connexion_cmd, $0) + } + else + print "No current page." +} + $1 == "toc" { if (!PAGE_TITLE_NUM) { print "No title found."