Anonymous avatar Anonymous committed 82bdd9b

* Fixed docs to reflect new files() usage and simplified constructor so it does not accept an array of files anymore.

Comments (0)

Files changed (1)

Trunk/VersionControl/Hg/Command/Cat.php

  * You may also specify multiple files:
  * <code>
  * $hg = new VersionControl_Hg('/path/to/repo');
- * $hg->cat(array('file1', 'file2'))->run();
+ * $hg->cat()->files(array('file1', 'file2'))->run();
+ * </code>
+ * or use a pattern:
+ * <code>
+ * $hg->cat()->files(array('glob'=> '**.php'))->run();
  * </code>
  *
  * Additionaly, you may cat the contents of a file at a specific revision:
         $this->hg = $hg;
 
         /* should always be called so we have a full array of valid options */
-        $this->setOptions(array()); //$params
+        $this->setOptions(array());
 
-        /* We handle the actual param handling here, since we only expect
-         * 1 or more file names. */
-        if ( is_array($params[0]) ) {
-            $this->addOption('files', join(' ', $params[0]));
-        } elseif ( is_scalar($params[0]) ) {
+        /* $params is always an array with key [0] since we use
+         * call_user_func_array() */
+        if ( is_scalar($params[0]) ) {
             $this->addOption('files', $params[0]);
         } elseif ( is_null($params[0]) ) {
-            //throw an exception
-        } /* Note: $params is always an array with key [0] since we use
-           * call_user_func_array() */
+            //throw an exception (?)
+        }
     }
 
     /**
      * the command line.
      *
      * Usage:
-     * <code>$hg->log()->files(array('index.php'))->run();</code>
+     * <code>$hg->cat()->files(array('index.php'))->run();</code>
      * or
-     * <code>$hg->log(array('files' => array('index.php')))->run();</code>
+     * <code>$hg->cat(array('files' => array('index.php')))->run();</code>
      *
      * @param mixed $files the list of files as a simple array
      *
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.