@@ -24,7 +24,7 @@ require_once "PEAR/Config.php";
24
24
require_once "PEAR/Command.php " ;
25
25
require_once "Console/Getopt.php " ;
26
26
27
- error_reporting (E_ALL & ~ E_NOTICE );
27
+ error_reporting (E_ALL );
28
28
29
29
PEAR_Command::setUIType ('CLI ' );
30
30
$ all_commands = PEAR_Command::getCommands ();
@@ -81,10 +81,10 @@ foreach ($opts as $opt) {
81
81
$ config ->remove ($ param , 'user ' );
82
82
break ;
83
83
case 'v ' :
84
- $ verbose++ ;
84
+ $ config -> set ( ' verbose ' , $ verbose + 1 ) ;
85
85
break ;
86
86
case 'q ' :
87
- $ verbose-- ;
87
+ $ config -> set ( ' verbose ' , $ verbose - 1 ) ;
88
88
break ;
89
89
}
90
90
}
@@ -107,11 +107,13 @@ if (empty($all_commands[$command]) || $command == 'help') {
107
107
usage (null , @$ options [1 ][2 ]);
108
108
}
109
109
110
- $ cmd = PEAR_Command::factory ($ command );
110
+ $ cmd = PEAR_Command::factory ($ command, $ config );
111
111
if (PEAR ::isError ($ cmd )) {
112
112
die ($ cmd ->getMessage ());
113
113
}
114
- $ ok = $ cmd ->run ($ command , $ cmdopts , $ cmdargs );
114
+
115
+ $ cmdargs = array_slice ($ options [1 ], 2 );
116
+ $ ok = $ cmd ->run ($ command , $ cmdargs );
115
117
if ($ ok === false ) {
116
118
PEAR ::raiseError ("unknown command ` $ command' " );
117
119
}
@@ -147,7 +149,7 @@ function usage($error = null, $helpsubject = null)
147
149
} else {
148
150
fputs ($ stderr ,
149
151
"Type \"$ progname help options \" to list all options. \n" );
150
- }
152
+ }
151
153
fputs ($ stderr ,
152
154
"Commands: \n " . implode ("\n " , array_keys ($ all_commands )) .
153
155
"\n" );
0 commit comments