> > > The --config option is detected just before the other options by running > > the same loop a little earlier. However, to same CPU cycles, we break out > > of the loop as soon as --config is identified. I have extended that loop > so > > that it detects --no-config too and breaks out the moment either one of > > these is seen. Hence, only the first instance is acted upon, while the > > others are silently discarded. > > Thanks for making this point clear. > > I don't understand the reason for the --config exception and I would > definitely implement it in a different way... but changing it will break > compatibility. > The reason for having the separate loop is as follows:
In case the user wants to use a config file that is not /etc/wgetrc and ~/.wgetrc, then they may use the --config option. However, We tend to initialize the settings from these files before beginning to read the command line arguments. This would cause wrong settings to be read from the default config files. Hence, we run a loop to simply check for the --config option and then parse the given wgetrc file before parsing the rest of the options. I have simply added another check to that first loop. I too would like to implement this in a different manner. Do you have any ideas that we could use to implement this? There's a couple of implementation ideas I currently have, but I'll have to go back to the code and check its feasibility first. If it looks possible, I'll send a new RFC with the precise details of how I intend to implement this. -- Thanking You, Darshit Shah
