@spinajs/cli
Advanced tools
Comparing version 2.0.252 to 2.0.253
@@ -43,7 +43,11 @@ "use strict"; | ||
this.Log.trace(`Found command ${cmd.name}`); | ||
const cMeta = Reflect.getMetadata(decorators_js_1.META_COMMAND, cmd.instance); | ||
const oMeta = Reflect.getMetadata(decorators_js_1.META_OPTION, cmd.instance); | ||
const aMeta = Reflect.getMetadata(decorators_js_1.META_ARGUMENT, cmd.instance); | ||
const cMeta = Reflect.getMetadata(decorators_js_1.META_COMMAND, cmd.type); | ||
const oMeta = Reflect.getMetadata(decorators_js_1.META_OPTION, cmd.type); | ||
const aMeta = Reflect.getMetadata(decorators_js_1.META_ARGUMENT, cmd.type); | ||
if (!cMeta) { | ||
this.Log.warn(`Command ${cmd.name} is not marked as command. Use decorators to add description to command`); | ||
continue; | ||
} | ||
const c = commander_1.program.command(cMeta.nameAndArgs, cMeta.description, cMeta.opts); | ||
oMeta.forEach((o) => { | ||
oMeta?.forEach((o) => { | ||
if (o.required) { | ||
@@ -56,3 +60,3 @@ c.requiredOption(o.flags, o.description, o.parser, o.defaultValue); | ||
}); | ||
aMeta.forEach((a) => { | ||
aMeta?.forEach((a) => { | ||
c.argument(a.name, a.description, a.parser, a.defaultValue); | ||
@@ -59,0 +63,0 @@ }); |
@@ -26,7 +26,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
this.Log.trace(`Found command ${cmd.name}`); | ||
const cMeta = Reflect.getMetadata(META_COMMAND, cmd.instance); | ||
const oMeta = Reflect.getMetadata(META_OPTION, cmd.instance); | ||
const aMeta = Reflect.getMetadata(META_ARGUMENT, cmd.instance); | ||
const cMeta = Reflect.getMetadata(META_COMMAND, cmd.type); | ||
const oMeta = Reflect.getMetadata(META_OPTION, cmd.type); | ||
const aMeta = Reflect.getMetadata(META_ARGUMENT, cmd.type); | ||
if (!cMeta) { | ||
this.Log.warn(`Command ${cmd.name} is not marked as command. Use decorators to add description to command`); | ||
continue; | ||
} | ||
const c = program.command(cMeta.nameAndArgs, cMeta.description, cMeta.opts); | ||
oMeta.forEach((o) => { | ||
oMeta?.forEach((o) => { | ||
if (o.required) { | ||
@@ -39,3 +43,3 @@ c.requiredOption(o.flags, o.description, o.parser, o.defaultValue); | ||
}); | ||
aMeta.forEach((a) => { | ||
aMeta?.forEach((a) => { | ||
c.argument(a.name, a.description, a.parser, a.defaultValue); | ||
@@ -42,0 +46,0 @@ }); |
{ | ||
"name": "@spinajs/cli", | ||
"version": "2.0.252", | ||
"version": "2.0.253", | ||
"description": "SpinaJS command line module", | ||
@@ -45,7 +45,7 @@ "main": "lib/cjs/index.js", | ||
"dependencies": { | ||
"@spinajs/configuration": "^2.0.252", | ||
"@spinajs/di": "^2.0.252", | ||
"@spinajs/exceptions": "^2.0.252", | ||
"@spinajs/log": "^2.0.252", | ||
"@spinajs/reflection": "^2.0.252", | ||
"@spinajs/configuration": "^2.0.253", | ||
"@spinajs/di": "^2.0.253", | ||
"@spinajs/exceptions": "^2.0.253", | ||
"@spinajs/log": "^2.0.253", | ||
"@spinajs/reflection": "^2.0.253", | ||
"commander": "10.0.0", | ||
@@ -52,0 +52,0 @@ "reflect-metadata": "^0.1.13" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175913
596
Updated@spinajs/di@^2.0.253
Updated@spinajs/exceptions@^2.0.253
Updated@spinajs/log@^2.0.253
Updated@spinajs/reflection@^2.0.253