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

cilly

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cilly - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

4

dist/cli-command.d.ts

@@ -41,2 +41,3 @@ export declare type ArgumentValue = any;

consumeUnknownOpts?: boolean;
exitOnHelp?: boolean;
};

@@ -71,2 +72,3 @@ export declare type OptionDefinition = {

private inheritOpts?;
private exitOnHelp?;
private consumeUnknownOpts?;

@@ -141,2 +143,4 @@ private args;

private isEmpty;
private isHelpOption;
private handleHelpOption;
}

27

dist/cli-command.js

@@ -17,3 +17,7 @@ "use strict";

class CliCommand {
constructor(name, opts = { inheritOpts: false, consumeUnknownOpts: false }) {
constructor(name, opts = {
inheritOpts: false,
consumeUnknownOpts: false,
exitOnHelp: true
}) {
this.args = []; // Needs to be an array because we have to pick arguments in order

@@ -31,2 +35,3 @@ this.opts = {};

this.inheritOpts = opts.inheritOpts;
this.exitOnHelp = opts.exitOnHelp;
this.consumeUnknownOpts = opts.consumeUnknownOpts;

@@ -36,9 +41,3 @@ this.helpHandler = presentation_1.showHelp;

name: ['-h', '--help'],
description: 'Display help for command',
hook: (value) => {
if (value) {
this.helpHandler(this.dump());
process.exit(0);
}
}
description: 'Display help for command'
});

@@ -131,2 +130,5 @@ }

if (token_parser_1.TokenParser.isOptionName(next)) {
if (this.isHelpOption(next)) {
this.handleHelpOption();
}
const parsed = this.consumeOption(q);

@@ -436,4 +438,13 @@ if (!parsed)

}
isHelpOption(opt) {
return ['-h', '--help'].includes(opt);
}
handleHelpOption() {
this.helpHandler(this.dump());
if (this.exitOnHelp) {
process.exit(0);
}
}
}
exports.CliCommand = CliCommand;
//# sourceMappingURL=cli-command.js.map
{
"name": "cilly",
"version": "1.0.2",
"version": "1.0.3",
"description": "The last library you'll ever need for building intuitive, robust and flexible CLI tools with Node.js and TypeScript.",

@@ -14,3 +14,6 @@ "main": "dist/index.js",

"include": "src",
"exclude": "src/presentation.ts"
"exclude": [
"src/presentation.ts",
"*/**/*.test.ts"
]
},

@@ -17,0 +20,0 @@ "repository": {

@@ -9,1 +9,35 @@ # Cilly

# Table of contents
- [Installation](#installation)
- [Basic usage](#basic-usage)
- [Documentation](#documentation)
- [Arguments](#arguments)
- [Options](#options)
- [Commands](#commands)
- [Subcommands](#subcommands)
- [Option inheritance](#option-inheritance)
- [Validators](#validators)
- [Hooks](#hooks)
- [Generating documentation](#generating-documentation)
- [Custom help handlers](#custom-help-handlers)
- [Custom exception handling](#custom-exception-handling)
# Installation
```
npm install cilly
```
# Basic usage
# Documentation
## Commands
### Subcommands
### Option inheritance
## Arguments
## Options
## Validators
## Hooks
## Generating documentation
## Custom help handlers
## Custom exception handling
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