cvs: peardoc /en/package/console/console-commandline sub-commands.xml

[email protected] ("David JEAN LOUIS")
Newsgroups php.pear.doc
Message-ID <cvsizi1244466582@cvsserver>
izi		Mon Jun  8 13:09:42 2009 UTC

  Modified files:              
    /peardoc/en/package/console/console-commandline	sub-commands.xml 
  Log:
  added documentation for sub-command aliases
  
http://cvs.php.net/viewvc.cgi/peardoc/en/package/console/console-commandline/sub-commands.xml?r1=1.1&r2=1.2&diff_format=u
Index: peardoc/en/package/console/console-commandline/sub-commands.xml
diff -u peardoc/en/package/console/console-commandline/sub-commands.xml:1.1 peardoc/en/package/console/console-commandline/sub-commands.xml:1.2
--- peardoc/en/package/console/console-commandline/sub-commands.xml:1.1	Sat Dec  6 15:01:01 2008
+++ peardoc/en/package/console/console-commandline/sub-commands.xml	Mon Jun  8 13:09:42 2009
@@ -142,6 +142,23 @@
 
    </para>
    <para>
+      Also note that sub-commands support aliases, for example it is possible 
+      to have an "update" command and specify "up" as an alias (shortcut) of 
+      the command:
+     <programlisting role="php">
+       <![CDATA[
+<?php
+
+$parser->addCommand('update', array(
+    'description' => 'Update the given package',
+    'aliases'     => array('up'), // we can have more than 1 alias
+));
+
+?>
+       ]]>
+     </programlisting>
+   </para>
+   <para>
      So far, so good, now let's see how to use this parser.
      When a user type a sub-command in the command line, the result object will
      have two properties set: the
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.