INNER CODE UNIT · TypeScript

async

Serverless-Devs/Serverless-Devs · src/command/cli/index.ts:23

export default async (program: Command) => {
  const { _: raw = [], help } = utils.parseArgv(process.argv.slice(2));
  if (raw[0] !== 'cli') return;

  const cliProgram = program
    .command('cli')
    .description(description)
    .summary(`Command line operation without yaml mode`)
    .option('-p, --props <jsonString>', 'The json string of props', v => isJson(v))
    .option('-h, --help', 'Display help for command', undefined) // 避免自动调用help信息(s cli fc -h)
    .allowUnknownOption();
  // s cli or s cli -h
  if (raw.length === 1 || (raw.length === 1 && help)) {
    cliProgram.help();
  }
  const [componentName] = raw.slice(1);
  const v3 = await isFc3(componentName);
  if (!v3) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…