Socket
Socket
Sign inDemoInstall

argh

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

argh - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

6

CHANGELOG.md

@@ -0,1 +1,7 @@

### 0.1.3
- Allow every printable ASCII char to be used within arguments. #9
### 0.1.2
- Allow `+` to be used within arguments. #8
### 0.1.1

@@ -2,0 +8,0 @@ - Fixed a bug where long arguments with `/` file slashes were ignored.

2

index.js

@@ -53,3 +53,3 @@ 'use strict';

insert(argh, data[1], true, option);
} else if (data = /^--([^=]+)=\W?([\w\-\.\/+]+)\W?$/.exec(option)) {
} else if (data = /^--([^=]+)=\W?([\s!#$%&\x28-\x7e]+)\W?$/.exec(option)) {
//

@@ -56,0 +56,0 @@ // --foo="bar" and --foo=bar are alternate styles to --foo bar.

{
"name": "argh",
"version": "0.1.2",
"version": "0.1.3",
"description": "light weight option/argv parser for node, it only parses options, nothing more then that.",

@@ -30,6 +30,6 @@ "main": "index.js",

"devDependencies": {
"chai": "1.5.x",
"mocha": "1.9.x",
"assume": "0.0.x",
"mocha": "1.20.x",
"pre-commit": "0.0.x"
}
}
describe('argh', function () {
'use strict';
var argh = require('../')
, chai = require('chai')
, expect = chai.expect;
var expect = require('assume')
, argh = require('../');
chai.Assertion.includeStack = true;
/**

@@ -123,2 +120,15 @@ * Helper function so we don't have to create arrays for our tests, but we can

it('correctly passes arguments in the ascii printable range.', function () {
for (var i = 32; i <= 126; i++) {
// Skip over the chars `'` and `"`
if (i === 34 || i === 29) return;
var char = String.fromCharCode(i);
var args = parse('--one="1' + char + '1"', '--two=2' + char + '2', '--three', '3' + char + '3');
expect(args.one).to.equal('1' + char + '1');
expect(args.two).to.equal('2' + char + '2');
expect(args.three).to.equal('3' + char + '3');
}
});
it('correctly parses arguments with filenames', function () {

@@ -125,0 +135,0 @@ var args = parse('--realFilePath=some/path/file.js', 'some/path/file2.js');

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