Compare commits

..

2 Commits

Author SHA1 Message Date
b7957b0ab6 4.0.4 2022-08-03 20:21:54 +02:00
99a0a9ca81 fix(core): update 2022-08-03 20:21:54 +02:00
4 changed files with 12 additions and 11 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@pushrocks/smartcli", "name": "@pushrocks/smartcli",
"version": "4.0.3", "version": "4.0.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@pushrocks/smartcli", "name": "@pushrocks/smartcli",
"version": "4.0.3", "version": "4.0.4",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@pushrocks/lik": "^6.0.0", "@pushrocks/lik": "^6.0.0",

View File

@ -1,7 +1,7 @@
{ {
"name": "@pushrocks/smartcli", "name": "@pushrocks/smartcli",
"private": false, "private": false,
"version": "4.0.3", "version": "4.0.4",
"description": "easy observable cli tasks", "description": "easy observable cli tasks",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartcli', name: '@pushrocks/smartcli',
version: '4.0.3', version: '4.0.4',
description: 'easy observable cli tasks' description: 'easy observable cli tasks'
} }

View File

@ -95,12 +95,6 @@ export class Smartcli {
*/ */
public addVersion(versionArg: string) { public addVersion(versionArg: string) {
this.version = versionArg; this.version = versionArg;
this.addCommandAlias('v', 'version');
this.parseCompleted.promise.then((argv) => {
if (argv.v) {
console.log(this.version);
}
});
} }
/** /**
@ -133,8 +127,15 @@ export class Smartcli {
return true; return true;
} }
}); });
const wantedCommand = parsedYArgs._[0];
// lets handle some standards
if (!wantedCommand && (parsedYArgs.v || parsedYArgs.version)) {
console.log(this.version || 'unknown version');
return;
}
for (const command of this.commandObservableMap.getArray()) { for (const command of this.commandObservableMap.getArray()) {
const wantedCommand = parsedYArgs._[0];
if (!wantedCommand) { if (!wantedCommand) {
const standardCommand = this.commandObservableMap.findSync((commandArg) => { const standardCommand = this.commandObservableMap.findSync((commandArg) => {
return commandArg.commandName === 'standardCommand'; return commandArg.commandName === 'standardCommand';