gem.awk

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

commit f3691d33398b058fc810a0ab3793a9df314b52cf
parent 30cc867ad5105f9795f55fe73a079554e2e40a54
Author: Léo Villeveygoux <l@vgx.fr>
Date:   Wed,  3 Jun 2020 04:30:39 +0200

Use secondary prompt for special actions

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

diff --git a/gem.awk b/gem.awk @@ -71,7 +71,7 @@ function gemini_url_open(url) { close(connexion_cmd) print "Binary filetype: " $2 print "Blank to ignore, '| cmd' or '> file' to redirect" - prompt() + prompt("Redirection ") getline if (/^[|>]/) plumb_out(connexion_cmd, $0) @@ -84,8 +84,8 @@ function gemini_url_open(url) { } } -function prompt() { - printf PAGE_URL "\033[1m>\033[0m " +function prompt(str) { + printf("%s%s", (str ? str : PAGE_URL), "\033[1m>\033[0m ") } function help() { @@ -120,7 +120,7 @@ $1 ~ /^[[:digit:]]+$/ { gemini_url_open(url) } else { print "Not a gemini URL, open with (blank to ignore):" - prompt() + prompt("System command") getline if($0) system($0 " '" url "'")