@@ -37,7 +37,7 @@ const installModulesAndLoadGenerator = (generatorPath, generatorName) => {
3737
3838const runYeoman = async ( generatorPath , attributes , options ) => {
3939 const generatorName = registerGenerator ( generatorPath ) ;
40- const generatorArgs = compact ( [ generatorName , attributes ] ) ;
40+ const generatorArgs = compact ( [ generatorName ] . concat ( attributes ) ) ;
4141 await yeomanEnv . run ( generatorArgs , options ) ;
4242}
4343
@@ -104,17 +104,18 @@ const description = `Run generator
104104program
105105 . name ( 'pos-cli generate' )
106106 . description ( description )
107- . arguments ( '<generatorPath> [generatorAttributes]' , 'path to the generator directory' )
107+ . arguments ( '<generatorPath>' , 'path to the generator directory' )
108+ . argument ( '[generatorArguments...]' , 'generator arguments' )
108109 . option ( '--generator-help' , 'show help for given generator' )
109110 . allowUnknownOption ( )
110- . usage ( "<generatorPath> [generatorAttributes] " , 'arguments that will be passed to the generator' )
111- . action ( async function ( generatorPath , generatorAttributes , options , command ) {
111+ . usage ( "<generatorPath> <generatorArguments...> " , 'arguments that will be passed to the generator' )
112+ . action ( async function ( generatorPath , generatorArguments , options , command ) {
112113 try {
113114 if ( options . generatorHelp ) {
114115 showHelpForGenerator ( generatorPath ) ;
115116 } else {
116117 const extraOptions = unknownOptions ( command ) ;
117- await runYeoman ( generatorPath , generatorAttributes , extraOptions ) ;
118+ await runYeoman ( generatorPath , generatorArguments , extraOptions ) ;
118119 }
119120 } catch ( e ) {
120121 logger . Error ( `Error: ${ e . message } ` , { exit : false } ) ;
0 commit comments