Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@helios-lang/cli-utils

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@helios-lang/cli-utils - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

package.json
{
"name": "@helios-lang/cli-utils",
"version": "0.1.1",
"version": "0.1.2",
"description": "Simplest possible cli library",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -83,7 +83,7 @@ import {} from "@helios-lang/type-utils"

if (i >= this.args.length - 1) {
throw new CliError(`expected argument after ${this.args[i]}`)
}
if (i >= 0) {
if (i >= this.args.length - 1) {
throw new CliError(`expected argument after ${this.args[i]}`)
}
if (i >= 0) {
if (this.used.has(i + 1)) {

@@ -90,0 +90,0 @@ throw new CliError(

@@ -41,3 +41,3 @@ import { ArgReader } from "../ArgReader.js"

makeHelp() {
return `${this.long}${this.short ? `, ${this.short}` : ""} <${this.variants.join(" | ")}> ${this.description}`
return `${this.long}${this.short ? `, ${this.short}` : ""} <${this.variants.join(" | ")}> ${this.description ?? ""}`
}

@@ -44,0 +44,0 @@

@@ -33,3 +33,3 @@ import { ArgReader } from "../ArgReader.js"

makeHelp() {
return `${this.long}${this.short ? `, ${this.short}` : ""}`
return `${this.long}${this.short ? `, ${this.short}` : ""} ${this.description ?? ""}`
}

@@ -45,37 +45,1 @@

}
/**
* @typedef {OptConfig & {
* default?: string | (() => string)
* }} StringOptConfig
*/
/**
* @implements {Opt<string>}
*/
export class StringOpt {
/**
* @param {StringOptConfig} param0
*/
constructor({ long, short, description, default: def }) {
this.long = long
this.short = short
this.description = description
this.default = def
}
/**
* @returns {string}
*/
makeHelp() {
return `${this.long}${this.short ? `, ${this.short}` : ""} <arg> ${this.description}`
}
/**
*
* @param {ArgReader} r
*/
read(r) {
return r.readOption(this.long, this.short, this.default)
}
}

@@ -36,3 +36,3 @@ import { ArgReader } from "../ArgReader.js"

makeHelp() {
return `${this.long}${this.short ? `, ${this.short}` : ""} <arg> ${this.description}`
return `${this.long}${this.short ? `, ${this.short}` : ""} <arg> ${this.description ?? ""}`
}

@@ -39,0 +39,0 @@

@@ -32,36 +32,6 @@ /**

}
/**
* @typedef {OptConfig & {
* default?: string | (() => string)
* }} StringOptConfig
*/
/**
* @implements {Opt<string>}
*/
export class StringOpt implements Opt<string> {
/**
* @param {StringOptConfig} param0
*/
constructor({ long, short, description, default: def }: StringOptConfig);
long: string;
short: string | undefined;
description: string | undefined;
default: string | (() => string) | undefined;
/**
* @returns {string}
*/
makeHelp(): string;
/**
*
* @param {ArgReader} r
*/
read(r: ArgReader): string;
}
export type OptConfig = import("./Opt.js").OptConfig;
export type Opt<T> = import("./Opt.js").Opt<T>;
export type FlagOptConfig = OptConfig;
export type StringOptConfig = OptConfig & {
default?: string | (() => string);
};
import { ArgReader } from "../ArgReader.js";
//# sourceMappingURL=FlagOpt.d.ts.map

Sorry, the diff of this file is not supported yet

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