From a639d5e86bfa941153e214dc0c44d780072769ea Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Sat, 16 Feb 2019 16:04:14 +0000 Subject: [PATCH] accept -p for progress bar --- doc/zpm-fetchurl.8 | 6 +++--- src/fetchurl.c | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/zpm-fetchurl.8 b/doc/zpm-fetchurl.8 index 8f93859..d3948df 100644 --- a/doc/zpm-fetchurl.8 +++ b/doc/zpm-fetchurl.8 @@ -4,7 +4,7 @@ zpm-fetchurl \- download files .SH SYNOPSIS .B zpm fetchurl [ -.B -ISkKrOn +.B -ISkKrOnp ] [ .BI -o file @@ -60,8 +60,8 @@ Only if newer. Like \-z, except use the output file name, if any. .B \-f Fail silently on errors. .TP -.B \-# -Output a progress bar. +.B \-p \-# +Output a progress bar. A '#' is accepted for compatibility with curl. .SH EXAMPLES .TP zpm fetchurl -o zpm-0.1.2.zpm https://zoranix.net/repo/packages/zpm-0.1.2.zpm diff --git a/src/fetchurl.c b/src/fetchurl.c index 395ce95..2f144d6 100644 --- a/src/fetchurl.c +++ b/src/fetchurl.c @@ -587,7 +587,7 @@ int main(int ac, char *av[]) { ltc_mp = tfm_desc; - while ((option = getopt(ac, av, "o:OrIfz:n#R:SkK")) != -1) { + while ((option = getopt(ac, av, "o:OrIfz:np#R:SkK")) != -1) { switch (option) { case 'o': outfile = optarg; break; case 'O': calcoutfile = 1; break; @@ -600,6 +600,7 @@ int main(int ac, char *av[]) { case 'z': lmfile = optarg; break; case 'n': ifnewer = 1; break; case 'R': redirlimit = strtol(optarg, 0, 10); break; + case 'p': case '#': progressbar = 1; break; default: exit(EXIT_FAILURE); -- 2.40.0