<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>107188</bug_id>
          
          <creation_ts>2013-01-17 15:11:29 -0800</creation_ts>
          <short_desc>Reorganize webkitdirs.pm into modular pieces</short_desc>
          <delta_ts>2013-01-26 00:30:21 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Farler">dfarler</reporter>
          <assigned_to name="David Farler">dfarler</assigned_to>
          <cc>ddkilzer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>809857</commentid>
    <comment_count>0</comment_count>
    <who name="David Farler">dfarler</who>
    <bug_when>2013-01-17 15:11:29 -0800</bug_when>
    <thetext>webkitdirs.pm is currently too state-oriented and overloaded in functionality to easily extend. I propose the following:

- Separate ports and extend a common interface
- Separate the concerns of command line options, utility functions, etc.
- Recommend rewrite in something like Python
- Automatically generate usage help using something like argparse
- Reduce reliance on state
- *Do not* mutate ARGV

For command line options:
- dynamically add argument sub-parsers depending on the tool and port

For utility functions:
- separate the various ports to ease merging and preventing interference

All of this might entail refactoring a lot of the tools but I think the long-term benefit would be worth it. Being able to centralize library behavior so that all ports can extend or utilize modules without interfering with each other would be a good thing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>