const codegen=require("./codegen"),argv=require("yargs").usage("Usage: $0 -s [wavemaker project path] -t [target location] [-c] [-g]").options({create:{alias:"c",type:"boolean"},deploy_url:{alias:"d",type:"string"},generate:{alias:"g",type:"boolean"},generate_page:{type:"string"},source:{alias:"s",describe:"source project web-app path",type:"string"},target:{alias:"t",describe:"target directory",type:"string"},codegenPath:{describe:"Codegen installation path",type:"string"}}).demandOption(["source","target"],"please provide source project and target directory paths").help().argv,create=async()=>{await codegen.createAppSkeleton(argv.source,argv.target)},generate=async()=>{await codegen.generateSources(argv.source,argv.target,argv.deploy_url)},generatePage=async()=>{await codegen.generatePage(argv.source,argv.target,argv.generate_page)},processRequest=async()=>{argv.create&&await create(),argv.generate&&await generate(),argv.generate_page&&await generatePage(),argv.create||argv.generate||argv.generate_page||(await create(),await generate())};processRequest();