Thanx Tony, Your OptionHowTo tutorial was very good. And I started thinking about contributing only after reading it. With every opensource project I want to start working, I dont find how to begin. Your tutorial helped alot.
but I thing you need to add more details, Instead of just telling how to do it, Give an example of implementing something very basic. that will drive more contributers I guess. I want to implement a batch download feature. Format: wget -batch 01-10 http://rahulprasad.com/pics/img[*].jpg this will add http://rahulprasad.com/pics/img01.jpg to http://rahulprasad.com/pics/img10.jpg to the queue. Plz tell me where show I add if(opt.batch) { // Loop // Add to queue. } Also, Please tell me the function used to add to queue. Or refer me to code where *add to queue* is implemented Regards Rahul Prasad --------------------------------------------------------- Web: www.rahulprasad.com 2010/10/14 Tony Lewis <[email protected]> > 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 > [email protected] 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. > >
