@shopify/cli
Version:
A CLI tool to build for the Shopify platform
5 lines (4 loc) • 1.23 kB
JavaScript
import{b as m}from"./chunk-XOTA6JTZ.js";import{C as f}from"./chunk-6G6TMKXF.js";import{r as N}from"./chunk-LDGAHMS7.js";import{Mb as c}from"./chunk-N5PQPIBF.js";import{e as v,g}from"./chunk-VPRTJUIN.js";g();var d=v(N(),1),i=class h extends m{static{this.description="View all the available command flags"}static{this.hidden=!0}static{this.flags={csv:d.Flags.boolean({description:"Output as CSV",env:"SHOPIFY_FLAG_OUTPUT_CSV",default:!1})}}async run(){let{flags:p}=await this.parse(h),s=[];for(let[t,a]of this.config.plugins)for(let o of a.commands){let l=await o.load(),n;a.name.startsWith("@shopify")?n=a.name.substring(9):n=a.name.startsWith("@oclif")?a.name.substring(7):a.name;let e=l.flags;if(e)for(let[u,r]of Object.entries(e))s.push({pluginName:n,command:o.id,flagName:`--${u}`,flagChar:r.char?`-${r.char}`:"",flagEnv:r.env})}if(p.csv){let t=["pluginName","command","flagName","flagChar","flagEnv"],a=`${t.join(",")}
`,o=s.map(n=>t.map(e=>n[e]).join(",")).join(`
`),l=`${a}${o}
`;c(l)}else f({rows:s,columns:{pluginName:{header:"plugin",color:"red"},command:{},flagName:{header:"long flag",color:"green"},flagChar:{header:"short flag",color:"green"},flagEnv:{header:"env variable",color:"blueBright"}}})}};export{i as a};