Socket
Socket
Sign inDemoInstall

clipanion

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clipanion - npm Package Compare versions

Comparing version 2.0.0-rc.8 to 2.0.0-rc.9

5

lib/advanced/Cli.d.ts

@@ -16,7 +16,10 @@ /// <reference types="node" />

private readonly binaryName;
private readonly version;
private readonly registrations;
constructor({ binaryName }?: {
constructor({ binaryName, version }?: {
binaryName?: string;
version?: string;
});
register(advancedCommand: CommandClass<Context>): void;
private registerVersion;
private registerGeneralHelp;

@@ -23,0 +26,0 @@ private registerDefinitions;

28

lib/advanced/Cli.js

@@ -24,6 +24,8 @@ "use strict";

class Cli {
constructor({ binaryName = `...` } = {}) {
constructor({ binaryName = `...`, version = `no version specified` } = {}) {
this.coreCli = new core.Cli();
this.registrations = [];
this.binaryName = binaryName;
this.version = version;
this.registerVersion();
this.registerDefinitions();

@@ -37,2 +39,26 @@ this.registerGeneralHelp();

}
registerVersion() {
const self = this;
class Version extends Command_1.Command {
async execute() {
this.context.stdout.write(`${self.version}\n`);
}
}
__decorate([
Command_1.Command.HideFromErrors()
], Version.prototype, "execute", null);
const coreCommand = Version.compile();
// We replace the link function so that we can inject a special logic
// into the state machine (instead of the default one which would check
// the path, options, etc).
coreCommand.link = function ({ proxyStart }) {
if (typeof proxyStart === `undefined` || proxyStart >= 1) {
const versionNode = this.createNode({ weight: 0, label: `activate the version` });
this.registerTransition(core.NODE_INITIAL, `-v`, versionNode);
this.registerTransition(core.NODE_INITIAL, `--version`, versionNode);
this.markTerminal(versionNode);
}
};
this.coreCli.register(coreCommand);
}
registerGeneralHelp() {

@@ -39,0 +65,0 @@ const self = this;

{
"name": "clipanion",
"version": "2.0.0-rc.8",
"version": "2.0.0-rc.9",
"main": "lib/advanced",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc