logo       

cvs: pear /PECL_Gen TODO package.xml pecl-gen: msg#00589

Subject: cvs: pear /PECL_Gen TODO package.xml pecl-gen
hholzgra                Sun Jun 29 14:24:08 2003 EDT

  Modified files:              
    /pear/PECL_Gen      TODO package.xml pecl-gen 
  Log:
  preparing for ext_skel BC support
  
  
Index: pear/PECL_Gen/TODO
diff -u pear/PECL_Gen/TODO:1.3 pear/PECL_Gen/TODO:1.4
--- pear/PECL_Gen/TODO:1.3      Sun Jun 29 13:24:00 2003
+++ pear/PECL_Gen/TODO  Sun Jun 29 14:24:08 2003
@@ -34,3 +34,4 @@
 - create just function stubs instead of complete
   extension (as supported by the old ext_skel)
 - README file generation
+- support ext_skel commandline options for BC reasons
Index: pear/PECL_Gen/package.xml
diff -u pear/PECL_Gen/package.xml:1.2 pear/PECL_Gen/package.xml:1.3
--- pear/PECL_Gen/package.xml:1.2       Sun Jun 29 10:06:01 2003
+++ pear/PECL_Gen/package.xml   Sun Jun 29 14:24:08 2003
@@ -31,6 +31,8 @@
     </notes>
                <deps>
                        <dep type="php" rel="ge" version="5.0"/>
+                       <dep type="pkg" rel="ge" version="1.0.1">XML_Parse</dep>
+      <dep type="pkg" rel="ge" version="1.0">Console_Getopt</dep>
          </deps>
     <filelist>
       <dir name="/" baseinstalldir="/">
Index: pear/PECL_Gen/pecl-gen
diff -u pear/PECL_Gen/pecl-gen:1.1 pear/PECL_Gen/pecl-gen:1.2
--- pear/PECL_Gen/pecl-gen:1.1  Sun Jun 29 08:24:54 2003
+++ pear/PECL_Gen/pecl-gen      Sun Jun 29 14:24:08 2003
@@ -5,11 +5,12 @@
 * Console script to generate PECL extensions from command line
 *
 * @author Hartmut Holzgraefe <hartmut@xxxxxx>
-* @version $Id: pecl-gen,v 1.1 2003/06/29 12:24:54 hholzgra Exp $
+* @version $Id: pecl-gen,v 1.2 2003/06/29 18:24:08 hholzgra Exp $
 */
 
 // includes
 require_once 'PEAR.php';
+require_once "Console/Getopt.php";
 require_once "PECL/Gen/Extension.php";
 require_once "PECL/Gen/ExtensionParser.php";
 
@@ -19,9 +20,30 @@
 // create extension object
 $extension = new PECL_Gen_Extension;
 
+$argv = Console_Getopt::readPHPArgv();
+$options = Console_Getopt::getopt($argv, "h?", 
+                                                                               
                                                        array( "help",  
+                                                                               
                                                                                
 "extname=", 
+                                                                               
                                                                                
 "full-xml", 
+                                                                               
                                                                                
 "no-help",
+                                                                               
                                                                                
 "proto=", 
+                                                                               
                                                                                
 "skel=", 
+                                                                               
                                                                                
 "stubs=", 
+                                                                               
                                                                                
 "xml==", 
+                                                                               
                                                                                
 ));
+
+
+if (count($options[1]) != 1) usage();
+
+$xmlfile = $options[1][0];
+
+if (!file_exists($xmlfile) || !is_readable($xmlfile)) {
+       die("Cannot open XML spec file '$xmlfile'");
+}
+
 // create XML parser for extension specs
 $parser    = new PECL_Gen_ExtensionParser($extension);
-$err = $parser->setInputFile("extension.xml");
+$err = $parser->setInputFile($xmlfile);
 if (PEAR::isError($err)) {
        die($err->message);
 }
@@ -36,6 +58,42 @@
 $err = $extension->create_extension();
 if (PEAR::isError($err)) {
        die($err->getMessage()." ".$err->getUserInfo());
+}
+
+exit(0);
+
+
+
+function usage($message = false)
+{
+       $fp = fopen("php://stderr", "w");
+
+       if ($message) fputs($fp, "$message\n\n");
+
+       fputs($fp, "Usage:
+
+pecl-gen [-h] [--extname=name] [--proto=file] [--skel=dir] [--stubs=file] 
+         [--no-help] [--xml[=file]] [--full-xml] [specfile.xml]
+
+  -h|--help         this message
+
+  the following options are inherited from ext_skel
+  they are accepted but currently not used in any way ...
+
+  --extname=module   module is the name of your extension
+  --proto=file       file contains prototypes of functions to create
+  --stubs=file       generate only function stubs in file
+  --xml              generate xml documentation to be added to phpdoc-cvs
+  --skel=dir         path to the skeleton directory
+  --full-xml         generate xml documentation for a self-contained extension
+                     (not yet implemented)
+  --no-help          don't try to be nice and create comments in the code
+                     and helper functions to test if the module compiled
+");
+
+       fclose($fp);
+
+       exit(3);
 }
 
 ?>



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe