Re: Mention multiple -O OK
On 21.02.23 04:12, Dan Jacobson wrote: "TR" == Tim Rühsen writes: TR> I'd consider adding a paragraph to the OPTIONS/"Option Syntax" TR> sections in the man/info page. TR> Would you like to come up with a suggestion ? All I know is the flustered -O user won't be looking there, but instead will be looking at the -O section of the man page. So sure, mention something in OPTIONS/"Option Syntax", but be sure to also mention something in the -O section. Also do it on the wget2 man page. As to what to mention in the -O section, say something like "A second -O will not do what you think..." Sounds good overall (waiting for a patch :-)). Just one suggestion, on the last sentence. Mayne not assume what a user thinks, better communicate what the option does and what it not does (the latter only if relevant). Regards, Tim OpenPGP_signature Description: OpenPGP digital signature
Re: Mention multiple -O OK
> "TR" == Tim Rühsen writes: TR> I'd consider adding a paragraph to the OPTIONS/"Option Syntax" TR> sections in the man/info page. TR> Would you like to come up with a suggestion ? All I know is the flustered -O user won't be looking there, but instead will be looking at the -O section of the man page. So sure, mention something in OPTIONS/"Option Syntax", but be sure to also mention something in the -O section. Also do it on the wget2 man page. As to what to mention in the -O section, say something like "A second -O will not do what you think..."
Re: Mention multiple -O OK
On 19.02.23 02:23, Darshit Shah wrote: On Fri, Feb 17, 2023, at 18:03, Tim Rühsen wrote: It is not possible to control the stored file names with multiple -O options (missing feature) Sorry, but no. This is not a missing feature. Its a long standing annoyance of mine but the manual describes -O as being equivalent to shell redirection. See the below selected quotes from the man page: ``` Use of -O is not intended to mean simply "use the name file instead of the one in the URL;" rather, it is analogous to shell redirection: wget -O file http://foo is intended to work like wget -O - http://foo > file; file will be truncated immediately, and all downloaded content will be written there. ``` And ``` Similarly, using -r or -p with -O may not work as you expect: Wget won't just download the first file to file and then download the rest to their normal names: all downloaded content will be placed in file. ``` Since this is a long standing documented "feature" I am not keen on modifying the default behavior as automated scripts that rely on it my break. This was the reason that the first thing I did with Wget2 was to remove that sentence and implication from its manual allowing for a more intuitive implementation of the -O option there. However, unfortunately, this non-intuitive behavuour of -O shall stay in Wget for the time being. Thanks for the clarification :) I think we are on the same page here. The "missing feature" was not meant to change the -O behavior, but more about having a feature that allows specifying names for multiple downloads. There are different ways to achieve that. E.g. one possible option could be to specify a well-formed CSV file with URL and file name as two columns. But it is easy to write such a tool either as a shell script or with the help of libwget (for the random reader: libwget is part of wget2). Regards, Tim OpenPGP_signature Description: OpenPGP digital signature
Re: Mention multiple -O OK
On Fri, Feb 17, 2023, at 18:03, Tim Rühsen wrote: > > It is not possible to control the stored file names with multiple -O > options (missing feature) Sorry, but no. This is not a missing feature. Its a long standing annoyance of mine but the manual describes -O as being equivalent to shell redirection. See the below selected quotes from the man page: ``` Use of -O is not intended to mean simply "use the name file instead of the one in the URL;" rather, it is analogous to shell redirection: wget -O file http://foo is intended to work like wget -O - http://foo > file; file will be truncated immediately, and all downloaded content will be written there. ``` And ``` Similarly, using -r or -p with -O may not work as you expect: Wget won't just download the first file to file and then download the rest to their normal names: all downloaded content will be placed in file. ``` Since this is a long standing documented "feature" I am not keen on modifying the default behavior as automated scripts that rely on it my break. This was the reason that the first thing I did with Wget2 was to remove that sentence and implication from its manual allowing for a more intuitive implementation of the -O option there. However, unfortunately, this non-intuitive behavuour of -O shall stay in Wget for the time being.
Re: Mention multiple -O OK
On 18.02.23 03:56, Dan Jacobson wrote: "TR" == Tim Rühsen writes: TR> It is not possible to control the stored file names with multiple -O TR> options (missing feature). Yes, so the man page should warn that multiple -O's is in fact NOT OK, i.e., will not do what the user thinks. Indeed, it's ok to give any option multiple times. Except when mentioned otherwise, the last option overrides the previous ones. AFAICS, this is a GNU standard. But you are right, that this could be mentioned explicitly. I'd consider adding a paragraph to the OPTIONS/"Option Syntax" sections in the man/info page. Would you like to come up with a suggestion ? Regards, Tim OpenPGP_signature Description: OpenPGP digital signature
Re: Mention multiple -O OK
> "TR" == Tim Rühsen writes: TR> It is not possible to control the stored file names with multiple -O TR> options (missing feature). Yes, so the man page should warn that multiple -O's is in fact NOT OK, i.e., will not do what the user thinks.
Re: Mention multiple -O OK
On 14.02.23 02:54, Dan Jacobson wrote: On (info "(wget) Download Options") and the man page too, mention that one can use multiple -O's in the same command: $ wget -O c emample.com -O n example.net ... thus saving tons of DNS queries! If you want to download several files/pages in one command line, like in wget URL1 URL2 ... and the domain names are the same, these files are fetched from a single connection (yes, also only 1 DNS query is done), if the server allows it. It is not possible to control the stored file names with multiple -O options (missing feature). Regards, Tim OpenPGP_signature Description: OpenPGP digital signature
Re: Mention multiple -O OK
> On (info "(wget) Download Options") and the man page too, > mention that one can use multiple -O's in the same command: > $ wget -O c emample.com -O n example.net ... > thus saving tons of DNS queries! Oops. Mention that this will be a disaster. As there is a bug: all will be written to "n". Be sure to mention something.