@@ -43,7 +43,7 @@ public static function products( $args, $assoc_args ) {
4343 $ progress = \WP_CLI \Utils \make_progress_bar ( 'Generating products ' , $ amount );
4444
4545 for ( $ i = 1 ; $ i <= $ amount ; $ i ++ ) {
46- Generator \Product::generate ();
46+ Generator \Product::generate ( true , $ assoc_args );
4747 $ progress ->tick ();
4848 }
4949
@@ -198,7 +198,27 @@ public static function coupons( $args, $assoc_args ) {
198198 }
199199}
200200
201- WP_CLI ::add_command ( 'wc generate products ' , array ( 'WC\SmoothGenerator\CLI ' , 'products ' ) );
201+ WP_CLI ::add_command ( 'wc generate products ' , array ( 'WC\SmoothGenerator\CLI ' , 'products ' ), array (
202+ 'shortdesc ' => 'Generate products. ' ,
203+ 'synopsis ' => array (
204+ array (
205+ 'name ' => 'amount ' ,
206+ 'type ' => 'positional ' ,
207+ 'description ' => 'The number of products to generate. ' ,
208+ 'optional ' => true ,
209+ 'default ' => 10 ,
210+ ),
211+ array (
212+ 'name ' => 'type ' ,
213+ 'type ' => 'assoc ' ,
214+ 'description ' => 'Specify one type of product to generate. Otherwise defaults to a mix. ' ,
215+ 'optional ' => true ,
216+ 'options ' => array ( 'simple ' , 'variable ' ),
217+ ),
218+ ),
219+ 'longdesc ' => "## EXAMPLES \n\nwc generate products 10 \n\nwc generate products 20 --type=variable " ,
220+ ) );
221+
202222WP_CLI ::add_command ( 'wc generate orders ' , array ( 'WC\SmoothGenerator\CLI ' , 'orders ' ), array (
203223 'synopsis ' => array (
204224 array (
@@ -229,6 +249,7 @@ public static function coupons( $args, $assoc_args ) {
229249 ),
230250 ),
231251) );
252+
232253WP_CLI ::add_command ( 'wc generate customers ' , array ( 'WC\SmoothGenerator\CLI ' , 'customers ' ) );
233254
234255WP_CLI ::add_command ( 'wc generate coupons ' , array ( 'WC\SmoothGenerator\CLI ' , 'coupons ' ), array (
0 commit comments