tAdd ability to toggle rendering options - webdump - [FORK] git://git.codemadness.org/webdump
 (HTM) git clone git://git.z3bra.org/webdump.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 6b646d82367267f2edf62cbbd5affb67f9767225
 (DIR) parent bed530b4daefa4d846e400873db07753a79694f8
 (HTM) Author: Willy Goiffon <contact@z3bra.org>
       Date:   Fri, 29 Nov 2019 10:49:14 +0100
       
       Add ability to toggle rendering options
       
       Diffstat:
         M webdump.1                           |      10 ++++++++++
         M webdump.c                           |      11 ++++++++++-
       
       2 files changed, 20 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/webdump.1 b/webdump.1
       t@@ -6,6 +6,7 @@
        .Nd dump and render HTML to stdout
        .Sh SYNOPSIS
        .Nm
       +.Op Fl als
        .Op Fl b Ar baseurl
        .Op Fl w Ar termwidth
        .Sh DESCRIPTION
       t@@ -15,6 +16,15 @@ It renders and writes the output as plain-text to stdout.
        A
        .Ar baseurl
        can be specified if the links in the feed are relative urls.
       +.Bl -tag
       +.It Fl a
       +Toggle ANSI escape codes usage.
       +.It Fl l
       +Toggle wether link references are displayed or not.
       +.It Fl s
       +Toggle wether "soft-wrapping" mode is enabled. Only used if a
       +.Ar termwidth
       +is specified.
        .Sh SEE ALSO
        .Xr ftp 1
        .Sh AUTHORS
 (DIR) diff --git a/webdump.c b/webdump.c
       t@@ -811,7 +811,7 @@ printlinkrefs(void)
        void
        usage(void)
        {
       -        fprintf(stderr, "%s [-b basehref] [-w termwidth]\n", argv0);
       +        fprintf(stderr, "%s [-als] [-b basehref] [-w termwidth]\n", argv0);
                exit(1);
        }
        
       t@@ -822,9 +822,18 @@ main(int argc, char **argv)
                        err(1, "pledge");
        
                ARGBEGIN {
       +        case 'a':
       +                allowansi = !allowansi;
       +                break;
                case 'b':
                        basehref = EARGF(usage());
                        break;
       +        case 'l':
       +                showlinkrefs = !showlinkrefs;
       +                break;
       +        case 's':
       +                softlinewrap = !softlinewrap;
       +                break;
                case 'w':
                        if ((termwidth = strtol(EARGF(usage()), NULL, 10)) < 1)
                                usage();