in src/cli/index.ts [54:99]
export async function run(argv?: string[]) {
printWelcomeMessage(argv);
notifyOnUpdate();
program
.name("swa")
.usage("[command] [options]")
.version(pkg.version, "-v, --version")
// SWA CLI common configuration options
.addOption(
new Option("-V, --verbose [prefix]", "enable verbose output. Values are: silly,info,log,silent")
.preset(DEFAULT_CONFIG.verbose)
.default(DEFAULT_CONFIG.verbose),
)
.option("-c, --config <path>", "path to swa-cli.config.json file to use", path.relative(process.cwd(), swaCliConfigFilename))
.option("-cn, --config-name <name>", "name of the configuration to use", undefined)
.option("-g, --print-config", "print all resolved options", false)
.action(async (_options: SWACLIConfig, command: Command) => {
const options = await configureOptions(undefined, command.optsWithGlobals(), command, "init");
swaMagic(options);
})
.addHelpText(
"after",
`
Type "swa" to get started and deploy your project.
Documentation:
https://aka.ms/swa/cli-local-development
`,
);
// Register commands
registerLogin(program);
registerStart(program);
registerDeploy(program);
registerInit(program);
registerBuild(program);
registerDocs(program);
registerDb(program);
program.showHelpAfterError();
program.addOption(new Option("--ping").hideHelp());
await program.parseAsync(argv);
}