cvs: php4 /pear/scripts pear.in
| From: | Tomas V.V.Cox | Date: | Sun, 26 May 2002 19:42:13 +0000 |
| Subject: | cvs: php4 /pear/scripts pear.in | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4113@lists.php.net to get a copy of this message | ||
cox Sun May 26 15:42:13 2002 EDT
Modified files:
/php4/pear/scripts pear.in
Log:
Added "pear -V" (show version information)
Index: php4/pear/scripts/pear.in
diff -u php4/pear/scripts/pear.in:1.54 php4/pear/scripts/pear.in:1.55
--- php4/pear/scripts/pear.in:1.54 Sun May 26 15:19:34 2002
+++ php4/pear/scripts/pear.in Sun May 26 15:42:13 2002
@@ -19,7 +19,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: pear.in,v 1.54 2002/05/26 19:19:34 ssb Exp $
+// $Id: pear.in,v 1.55 2002/05/26 19:42:13 cox Exp $
/**
* @nodep Gtk
@@ -40,7 +40,7 @@
$argv = Console_Getopt::readPHPArgv();
$progname = basename($argv[0]);
-$options = Console_Getopt::getopt($argv, "c:C:d:D:Gh?sSqu:v");
+$options = Console_Getopt::getopt($argv, "c:C:d:D:Gh?sSqu:vV");
if (PEAR::isError($options)) {
usage($options);
}
@@ -108,6 +108,8 @@
case 'q':
$config->set('verbose', $config->get('verbose') - 1);
break;
+ case 'V':
+ usage(null, 'version');
default:
// all non pear params goes to the command
$cmdopts[$opt[0]] = $param;
@@ -220,7 +222,9 @@
" -s store user configuration\n".
" -S store system configuration\n".
" -u foo unset `foo' in the user configuration\n".
- " -h, -? display help/usage (this message)\n";
+ " -h, -? display help/usage (this message)\n".
+ " -V version information\n";
+
} elseif ($command == "shortcuts") {
$sc = PEAR_Command::getShortcuts();
$ret = "Shortcuts:\n";
@@ -228,6 +232,11 @@
$ret .= sprintf(" %-8s %s\n", $s, $c);
}
return $ret;
+
+ } elseif ($command == "version") {
+ $reg = &new PEAR_Registry($config->get('php_dir'));
+ return "PEAR " . $reg->packageInfo('PEAR', 'version');
+
} elseif ($help = PEAR_Command::getHelp($command)) {
if (is_string($help)) {
return "pear $command [options] $help\n";