node-cipher
Advanced tools
Comparing version 2.4.4 to 2.4.5
@@ -7,14 +7,4 @@ #!/usr/bin/env node | ||
var xcrypt = require('./xcrypt'); | ||
var list = require('./list'); | ||
/** | ||
* List valid commands. | ||
*/ | ||
var commands = [ | ||
'encrypt', | ||
'decrypt', | ||
'list' | ||
]; | ||
/** | ||
* Base command line interface. | ||
@@ -29,4 +19,4 @@ */ | ||
.command('decrypt', 'Decrypt a given file', xcrypt) | ||
.command('list', 'List all available cipher algorithms', list) | ||
.epilogue('For more information, visit http://github.com/nathanbuchar/node-cipher') | ||
.describe('l', 'List all available cipher algorithms') | ||
.alias('l', 'list') | ||
.alias('h', 'help') | ||
@@ -36,9 +26,15 @@ .alias('v', 'version') | ||
.wrap(74) | ||
.epilogue('For more information, visit http://github.com/nathanbuchar/node-cipher') | ||
.argv; | ||
/** | ||
* Show help if the chosen command is invalid. | ||
* Show help menu if `list` is not chosen and the specified command is invalid. | ||
*/ | ||
if (commands.indexOf(argv._[0]) < 0) { | ||
if (argv.list) { | ||
var algorithmArray = nodecipher.list(); | ||
var algorithmList = algorithmArray.join(', '); | ||
console.log(algorithmList); | ||
} else if (['encrypt', 'decrypt'].indexOf(argv._[0]) < 0) { | ||
yargs.showHelp(); | ||
} |
@@ -42,6 +42,6 @@ #!/usr/bin/env node | ||
}) | ||
.epilogue('For more information, visit http://github.com/nathanbuchar/node-cipher') | ||
.alias('h', 'help') | ||
.help('h') | ||
.wrap(74) | ||
.epilogue('For more information, visit http://github.com/nathanbuchar/node-cipher') | ||
.argv; | ||
@@ -48,0 +48,0 @@ |
{ | ||
"name": "node-cipher", | ||
"version": "2.4.4", | ||
"version": "2.4.5", | ||
"description": "Encrypt or decrypt sensitive files to allow use in public source control.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -65,3 +65,3 @@ # node-cipher | ||
``` | ||
Usage: nodecipher <command> {options} | ||
Usage: nodecipher <command> | ||
@@ -73,6 +73,7 @@ | ||
decrypt Decrypt a given file. | ||
list List all available cipher options. | ||
Options: | ||
--list, -l List all available cipher algorithms. | ||
--help, -h Show the help menu. | ||
@@ -105,3 +106,3 @@ | ||
specified during encryption. By default, the encryption algorithm is set to | ||
`cast5-cbc`. Use `nodecipher list` to see a list of available cipher | ||
`cast5-cbc`. Use `nodecipher -l` to see a list of available cipher | ||
algorithms. (Optional; Default: cast5-cbc) | ||
@@ -161,3 +162,3 @@ | ||
|`password`|`string`|The encryption password. Unlike the command line interface, this MUST be specified.|Yes| | ||
|`algorithm`|`string`|The algorithm to use. Use `$ nodecipher list` to see a list of available cipher algorithms. Default: `cast5-cbc`|No| | ||
|`algorithm`|`string`|The algorithm to use. Use `nodecipher -l` to see a list of available cipher algorithms. Default: `cast5-cbc`|No| | ||
@@ -164,0 +165,0 @@ |
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
203
15016
11
269