astro

a POSIX shell compatible gemini client (mirror of https://github.com/blmayer/astro)
git clone https://git.clttr.info/astro.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit fe7cea4051d9435789de15f2990be24aed4f0e7e
parent 77791635d48e1966bbaae8b06e3a255285f2fd0b
Author: Brian Mayer <bleemayer@gmail.com>
Date:   Thu, 19 Jan 2023 14:24:20 -0300

Merge pull request #26 from rnwgnr/main

fix redirects
Diffstat:
Mastro | 41++++++++++++++++++++---------------------
1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/astro b/astro @@ -1,14 +1,13 @@ #!/bin/sh usage() { - echo "Astro v0.16.0: Browse the gemini web on the terminal." + echo "Astro v0.18.0: Browse the gemini web on the terminal." echo "" echo "Usage: astro [url]|[option]" echo "" echo "Options:" - echo " -h show this help" - echo " --help show this help" - echo " --version show version info" + echo " -h, --help show this help" + echo " -v, --version show version info" echo "" echo "Commands available inside the browser:" echo " q quit" @@ -32,11 +31,12 @@ usage() { echo "Report bugs to: bleemayer@gmail.com" echo "Home page: <https://www.github.com/blmayer/astro/>" echo "General help: <https://www.github.com/blmayer/astro/wiki>" + exit } version() { - echo "astro 0.16.0" - echo "Copyright (C) 2021 Brian Mayer." + echo "astro 0.18.0" + echo "Copyright (C) 2021-2023 Brian Mayer." echo "License MIT: MIT License <https://opensource.org/licenses/MIT>" echo "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND," echo "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF" @@ -49,6 +49,19 @@ debug() { [ "$debug" ] && echo "DEBUG: $*" >&2 && sleep 2 } +# Parse arguments +args="$*" +case "$args" in + '--help'* | '-h'*) + usage + exit + ;; + '--version'* | '-v'*) + version + exit + ;; +esac + # Save terminal tput smcup @@ -262,7 +275,7 @@ EOF # shellcheck disable=SC2046 read -r proto host port path << EOF - $(oldhost="$2" oldpath="$4" parseurl "$meta") + $(oldhost="$2" oldpath="$4" url="$meta" parseurl) EOF url="$proto://$host:$port/$path" return 0 @@ -391,20 +404,6 @@ EOF # Execution export LESS='-P Keys\: qgrbosHmM, to see a description run astro -h' -# Parse arguments -args="$*" -case "$args" in - '--help'* | '-h'*) - usage - exit - ;; - '--version'*) - version - exit - ;; -esac - - # First request url="${args:-$homepage}"