var p=(a,t,s)=>new Promise((u,c)=>{var i=n=>{try{r(s.next(n))}catch(o){c(o)}},e=n=>{try{r(s.throw(n))}catch(o){c(o)}},r=n=>n.done?u(n.value):Promise.resolve(n.value).then(i,e);r((s=s.apply(a,t)).next())});var d=a=>p(void 0,null,function*(){let s=yield a(`php -r 'print(json_encode(require "app/etc/env.php"));'`);return JSON.parse(s)}),m=a=>p(void 0,null,function*(){let t=yield d(a);return Object.keys(t.cache_types)}),l={name:"magento",description:"Open-source E-commerce",generateSpec:(a,t)=>p(void 0,null,function*(){let{stdout:s}=yield t({command:"bin/magento",args:["list","--format=json","--raw"]}),u=JSON.parse(s),c=yield m(t);return{name:"magento",description:"Open-source E-commerce",subcommands:u.commands.map(i=>({name:i.name,description:i.description,args:Object.values(i.definition.arguments).map(e=>{var n,o;let r=[];return i.name.startsWith("cache:")&&e.name==="types"&&r.push(...c),{name:e.name,description:e.description,isOptional:!e.is_required,default:(o=(n=e.default)==null?void 0:n.toString())!=null?o:"",isVariadic:e.is_array,suggestions:r}}),options:Object.values(i.definition.options).map(e=>({name:[e.name,...e.shortcut.split("|")||[]],description:e.description,isRequired:e.is_value_required,requiresEquals:e.accept_value}))}))}})},_=l;export{_ as default};
