New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cmded

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmded - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

3

lib/help.js

@@ -34,2 +34,5 @@ "use strict";

}
let title = help['@title'];
if (title)
parts.push(`\n${title}\n`);
parts.push('\nOptions:\n');

@@ -36,0 +39,0 @@ let keys = Object.keys(help).sort();

@@ -38,4 +38,6 @@ "use strict";

const default_formatter_1 = require("./default-formatter");
const Types = __importStar(require("./types"));
function CMDed(entryMethod, _options) {
let rootOptions = Object.assign({ strict: false, argv: process.argv.slice(2), parser: default_parser_1.defaultParser, formatter: default_formatter_1.defaultFormatter, helpArgPattern: '--help' }, (_options || {}));
rootOptions.types = Object.assign(Object.assign({}, Types), (rootOptions.types || {}));
let context = {};

@@ -47,2 +49,3 @@ let runnerContext = new runner_context_1.RunnerContext({

runnerPath: '',
types: rootOptions.types,
});

@@ -49,0 +52,0 @@ Object.defineProperties(context, {

@@ -12,2 +12,5 @@ import { GenericObject } from "./common";

helpArgPattern?: string | null;
types?: {
[key: string]: Function;
};
}

23

lib/runner-context.d.ts

@@ -1,4 +0,4 @@

import { Arguments } from "./arguments";
import { Arguments } from './arguments';
import { GenericObject } from './common';
import { RootOptions } from "./root-options";
import { RootOptions } from './root-options';
export declare type RunnerResult = Promise<boolean> | boolean;

@@ -16,2 +16,5 @@ export declare type Runner = {

runnerPath: string;
types?: {
[key: string]: Function;
};
}

@@ -26,8 +29,14 @@ export declare class RunnerContext {

get runnerPath(): string;
get Types(): {
[key: string]: Function;
};
clone: (options?: {
rootOptions?: RootOptions;
context?: GenericObject;
args?: Arguments;
runnerPath?: string;
}) => RunnerContext;
rootOptions?: RootOptions | undefined;
context?: GenericObject | undefined;
args?: Arguments | undefined;
runnerPath?: string | undefined;
types?: {
[key: string]: Function;
} | undefined;
} | undefined) => RunnerContext;
fetch: (_scope?: GenericObject | string, defaultValue?: any) => any;

@@ -34,0 +43,0 @@ store: (_scope: GenericObject | string, value?: any) => void;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -9,6 +32,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const help_1 = require("./help");
const Types = __importStar(require("./types"));
class RunnerContext {
constructor(options) {
this.clone = (options) => {
return new RunnerContext(Object.assign({ rootOptions: this.rootOptions, context: this.context, args: this.args, runnerPath: this.runnerPath }, (options || {})));
return new RunnerContext(Object.assign({ rootOptions: this.rootOptions, context: this.context, args: this.args, runnerPath: this.runnerPath, types: this.options.types }, (options || {})));
};

@@ -204,2 +228,5 @@ this.fetch = (_scope, defaultValue) => {

}
get Types() {
return this.options.types || Types;
}
get $() {

@@ -206,0 +233,0 @@ return this.match;

{
"name": "cmded",
"description": "CMDed is a command line argument parser made for humans",
"version": "1.1.0",
"version": "1.2.0",
"main": "lib/index",

@@ -6,0 +6,0 @@ "directories": {

@@ -284,2 +284,7 @@ # CMDed

### `@title`
If an `@title` key is specified in a scope or sub scope of the `help`, then it will be
shown directly under the `Usage: ` at the top of the help. This should describe what the command or sub-command does. If not provided for a sub-command, this will just fallback to some sane default, showing the user how to invoke the sub-command.
### `@examples`

@@ -293,6 +298,2 @@

### `@title`
Used for sub commands. This specifies some short title to show for the sub command. The sub command will then have its own `help` sub scope to fully describe the usage of the sub command. If not provided, this will just fallback to some sane default, showing the user how to invoke the sub command.
### `@see`

@@ -299,0 +300,0 @@

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