You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

cli-nano

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-nano - npm Package Compare versions

Comparing version

to
1.0.1

13

dist/index.js

@@ -225,2 +225,6 @@ import { camelToKebab, kebabToCamel, padString } from './utils.js';

const { command, options, version } = config;
// Helper to truncate with ellipsis
function truncateDesc(desc, max) {
return desc.length > max ? `${desc.slice(0, max - 3)}...` : desc;
}
// Build usage string for positionals

@@ -240,5 +244,6 @@ const usagePositionals = (command.positionals ?? [])

command.positionals?.forEach(arg => {
console.log(` ${arg.name.padEnd(20)}${arg.description.slice(0, 65).padEnd(65)}[${arg.type || 'string'}]`);
let desc = truncateDesc(arg.description, 65);
desc = desc.padEnd(65); // Always pad to 65 chars for alignment
console.log(` ${arg.name.padEnd(20)}${desc}[${arg.type || 'string'}]`);
});
// Build usage string for options
console.log('\nOptions:');

@@ -249,3 +254,5 @@ Object.keys(options).forEach(key => {

const aliasStr = option.alias ? `-${option.alias}, ` : '';
console.log(` ${aliasStr.padEnd(4)}--${key.padEnd(14)}${(option.description || '').slice(0, 65).padEnd(65)}[${option.type || 'string'}]${requiredStr}`);
let desc = truncateDesc(option.description || '', 65);
desc = desc.padEnd(65); // Always pad to 65 chars for alignment
console.log(` ${aliasStr.padEnd(4)}--${key.padEnd(14)}${desc} [${option.type || 'string'}]${requiredStr}`);
});

@@ -252,0 +259,0 @@ // Print default options (help and version)

{
"name": "cli-nano",
"version": "1.0.0",
"version": "1.0.1",
"description": "Mini command-line tool similar to `yargs` or `parseArgs` from Node.js that accepts positional arguments, flags and options.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -148,2 +148,3 @@ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

- [native-copyfiles](https://github.com/ghiscoding/native-copyfiles)
- [native-copyfiles](https://github.com/ghiscoding/native-copyfiles)
- [remove-glob](https://github.com/ghiscoding/remove-glob)

@@ -238,2 +238,7 @@ import type { ArgumentOptions, Config } from './interfaces.js';

// Helper to truncate with ellipsis
function truncateDesc(desc: string, max: number) {
return desc.length > max ? `${desc.slice(0, max - 3)}...` : desc;
}
// Build usage string for positionals

@@ -253,6 +258,7 @@ const usagePositionals = (command.positionals ?? [])

command.positionals?.forEach(arg => {
console.log(` ${arg.name.padEnd(20)}${arg.description.slice(0, 65).padEnd(65)}[${arg.type || 'string'}]`);
let desc = truncateDesc(arg.description, 65);
desc = desc.padEnd(65); // Always pad to 65 chars for alignment
console.log(` ${arg.name.padEnd(20)}${desc}[${arg.type || 'string'}]`);
});
// Build usage string for options
console.log('\nOptions:');

@@ -263,5 +269,5 @@ Object.keys(options).forEach(key => {

const aliasStr = option.alias ? `-${option.alias}, ` : '';
console.log(
` ${aliasStr.padEnd(4)}--${key.padEnd(14)}${(option.description || '').slice(0, 65).padEnd(65)}[${option.type || 'string'}]${requiredStr}`,
);
let desc = truncateDesc(option.description || '', 65);
desc = desc.padEnd(65); // Always pad to 65 chars for alignment
console.log(` ${aliasStr.padEnd(4)}--${key.padEnd(14)}${desc} [${option.type || 'string'}]${requiredStr}`);
});

@@ -268,0 +274,0 @@

Sorry, the diff of this file is not supported yet