bugGNU Wget - Bugs: bug #20445, The options/wget command code is...

 
 

bug #20445: The options/wget command code is too convoluted

Submitted by:  Micah Cowan <micahcowan>
Submitted on:  Tue 10 Jul 2007 11:42:25 PM UTC  
 
Category: Code ArchitectureSeverity: 3 - Normal
Priority: 5 - NormalStatus: Confirmed
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Open
Release: NoneOperating System: None
Reproducibility: NoneFixed Release: None
Planned Release: 2.0Regression: None
Work Required: 2 - WeeksPatch Included: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 10 Jul 2007 11:42:25 PM UTC, original submission:

There are too many places to look to see how an option is set on the command-line or wgetrc, what it's default value is, etc. To find out what opt field is set by a given command-line option, for example, you need to search for the command-line option in main.c's OPTION_DATA array, note the value of the DATA field, and use that to search in init.c's COMMANDS array. Then, to find its default value, you need to check init.c's DEFAULTS function.

Too involved. If necessary, the necessary data structures could be generated from a special source file designed to map a wgetrc command to its short and long options (if any), its internal "opt" structure member, its default value, tables of conflicting options, and perhaps its usage string and usage category. This could make maintenance and addition of new options much easier, as well as code comprehensibility.

Additional benefits would be that there's no particular need to keep options in alphabetical order, since the generator could re-sort them for binary searches. If we wish, we could generate tries instead of lists for lookup of options, resulting in O(N) complexity, rather than the current O(N log M), where N is the number of chars in the option or command name, and M is the number of entries. In addition, time would no longer be wasted on each invocation of wget to construct the table for getopt_long, which could already have been generated at build time.

Micah Cowan <micahcowan>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by micahcowan (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 20 Jul 2007 06:45:47 AM UTCmicahcowanPlanned ReleaseNone=>2.0

    Back to the top


    Powered by Savane 3.1-cleanup1