bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Bug-wget] QuickStart tutorial


From: Tony Lewis
Subject: RE: [Bug-wget] QuickStart tutorial
Date: Wed, 13 Oct 2010 16:21:02 -0700

Rahul Prasad wrote:

> I cant understand the flow of control. If you provide me with a quick
> tutorial on how to solve the problem that I have given, I can quick start
> coding instead of spending time in analyzing 1000 lines of code.

The tutorial shows you how to add a command-line option and a corresponding
value in the opt structure that will be set when the command-line option is
used. The magic part is the last line:

"Modify the processing of wget to take into account the value of
opt.variable"

Once you have added --rahul, you have to implement it in the appropriate
place with wget by doing something like this:

if (opt.rahul) {
  // implement the rahul feature
}

The magic part (figuring out where to add your new feature) is left as an
exercise to the reader. If your new feature is even vaguely related to some
existing feature then grep that feature. For example, looking at all
instances of opt.noclobber will reveal how --no-clobber is implemented.

If you want to add a new feature that's unlike any existing feature, you
will have to study the wget sources to determine where to insert your new
option. You could also describe the feature you want to implement on
address@hidden and you'll likely get some pointers as to which source
files to focus on.

Hope that helps.

PS) I wrote the Options How-To and welcome any feedback on its contents. I
probably should have included a deeper explanation of the "magic" part.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]