[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filena
From: |
Tim Rühsen |
Subject: |
Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl |
Date: |
Sat, 03 Aug 2013 16:11:59 +0200 |
User-agent: |
KMail/4.10.5 (Linux/3.10-1-amd64; KDE/4.10.5; x86_64; ; ) |
Ok, one step back.
We already have - conditionally compilable - PCRE library access plus POSIX
regex for --adjust and --reject, switchable by --regex-type.
Why not use similar mechanisms for consistency ?
--name-filter=REGEX
The content of REGEX then depends of the --regex-type (Posix is default).
--regex-type could be extended to support sh matching (fnmatch function).
The REGEX must contain a pattern for matching and a replacement string.
As a second option, we could introduce (now or later)
--name-filter-program="program REGEX"
The 'program' answers each line it gets (the original filename) by excactly one
output line (the new filename) as long as Wget does not close the pipe.
The 'program' needs to be started only once...
I admit, that I am not an regex expert (neither PCRE nor Posix) and I do not
know, how a proper match/replace pattern would look like (e.g. what syntax or
separation character should we use ?). Experts please....
The idea of having a program "to-get-it-all", e.g. meta information plus
content via pipe and/or environment vars, should be another project whenever
the need arises (i think is not the case right now).
Regards, Tim
signature.asc
Description: This is a digitally signed message part.
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Micah Cowan, 2013/08/01
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Andrew Cady, 2013/08/01
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Dagobert Michelsen, 2013/08/01
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Andrew Cady, 2013/08/02
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Tim Ruehsen, 2013/08/02
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Micah Cowan, 2013/08/02
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl,
Tim Rühsen <=
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Micah Cowan, 2013/08/03
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Ángel González, 2013/08/03
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Micah Cowan, 2013/08/04
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Ángel González, 2013/08/04
- Re: [Bug-wget] [PATCH] New option: --rename-output: modify output filename with perl, Ángel González, 2013/08/02