Comparing version 1.3.1 to 1.3.2
@@ -82,4 +82,5 @@ const rpad = require('pad-right'); | ||
// Strips leading `-|--` & extra space(s) | ||
exports.parse = function (str) { | ||
return (str || '').replace(/-{1,2}/g, '').split(/,?\s+/); | ||
return (str || '').split(/^-{1,2}|,|\s+-{1,2}|\s+/).filter(Boolean); | ||
} | ||
@@ -86,0 +87,0 @@ |
{ | ||
"name": "sade", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Smooth (CLI) operator 🎶", | ||
@@ -5,0 +5,0 @@ "repository": "lukeed/sade", |
@@ -286,11 +286,18 @@ # sade [![Build Status](https://travis-ci.org/lukeed/sade.svg?branch=master)](https://travis-ci.org/lukeed/sade) | ||
.option('-f, --force', 'Overwrite without confirmation') | ||
.option('-c, --clone-dir', 'Copy files to additional directory') | ||
.option('-v, --verbose', 'Enable verbose output') | ||
.action((src, dest, opts) => { | ||
console.log(`Copying files from ${src} --> ${dest}`); | ||
opts.c && console.log(`ALSO copying files from ${src} --> ${opts['clone-dir']}`); | ||
console.log('My options:', opts); | ||
}) | ||
// $ foo cp original clone -v | ||
//=> Copying files from original --> clone | ||
// $ foo cp original my-copy -v | ||
//=> Copying files from original --> my-copy | ||
//=> My options: { _:[], v:true, verbose:true } | ||
// $ foo cp original my-copy --clone-dir my-backup | ||
//=> Copying files from original --> my-copy | ||
//=> ALSO copying files from original --> my-backup | ||
//=> My options: { _:[], c:'my-backup', 'clone-dir':'my-backup' } | ||
``` | ||
@@ -326,2 +333,4 @@ | ||
> **Important:** If using hyphenated flag names, they will be accessible **as declared** within your [`action()`](#progactionhandler) handler! | ||
```js | ||
@@ -328,0 +337,0 @@ prog.option('--global'); // no alias |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19833
203
433