@tsed/cli-core
Version:
Build your CLI with TypeScript and Decorators
18 lines (17 loc) • 626 B
JavaScript
import { Store } from "@tsed/core";
import { CommandStoreKeys } from "../domains/CommandStoreKeys.js";
export function getCommandMetadata(token) {
const { name, alias, args = {}, allowUnknownOption, description, options = {}, enableFeatures, disableReadUpPkg, bindLogger = true, ...opts } = Store.from(token)?.get(CommandStoreKeys.COMMAND);
return {
name,
alias,
args,
description,
options,
allowUnknownOption: !!allowUnknownOption,
enableFeatures: enableFeatures || [],
disableReadUpPkg: !!disableReadUpPkg,
bindLogger,
...opts
};
}