coa 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cmd.js +3 -2
- package/lib/coaobject.js +1 -0
- package/lib/completion.js +1 -1
- package/package.json +3 -3
package/lib/cmd.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable class-methods-use-this */
|
1
2
|
'use strict';
|
2
3
|
|
3
4
|
const
|
@@ -191,9 +192,9 @@ class Cmd extends CoaObject {
|
|
191
192
|
}
|
192
193
|
|
193
194
|
_exit(msg, code) {
|
194
|
-
return process.once('exit', function() {
|
195
|
+
return process.once('exit', function(exitCode) {
|
195
196
|
msg && console[code === 0 ? 'log' : 'error'](msg);
|
196
|
-
process.exit(code || 0);
|
197
|
+
process.exit(code || exitCode || 0);
|
197
198
|
});
|
198
199
|
}
|
199
200
|
|
package/lib/coaobject.js
CHANGED
package/lib/completion.js
CHANGED
@@ -62,7 +62,7 @@ function dumpScript(name) {
|
|
62
62
|
|
63
63
|
fs.readFile(path.resolve(__dirname, 'completion.sh'), 'utf8', function(err, d) {
|
64
64
|
if(err) return defer.reject(err);
|
65
|
-
d = d.replace(/{{cmd}}/g, path.basename(name)).replace(
|
65
|
+
d = d.replace(/{{cmd}}/g, path.basename(name)).replace(/^#!.*?\n/, '');
|
66
66
|
|
67
67
|
process.stdout.on('error', onError);
|
68
68
|
process.stdout.write(d, () => defer.resolve());
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "coa",
|
3
3
|
"description": "Command-Option-Argument: Yet another parser for command line options.",
|
4
|
-
"version": "2.0.
|
4
|
+
"version": "2.0.1",
|
5
5
|
"homepage": "http://github.com/veged/coa",
|
6
6
|
"author": "Sergey Berezhnoy <veged@ya.ru> (http://github.com/veged)",
|
7
7
|
"maintainers": [
|
@@ -29,8 +29,8 @@
|
|
29
29
|
"devDependencies": {
|
30
30
|
"chai": "~1.7.2",
|
31
31
|
"coveralls": "^2.11.16",
|
32
|
-
"eslint": "^
|
33
|
-
"eslint-config-pedant": "^0.
|
32
|
+
"eslint": "^4.15.0",
|
33
|
+
"eslint-config-pedant": "^1.0.0",
|
34
34
|
"mocha": "~1.21.4",
|
35
35
|
"nyc": "^10.1.2"
|
36
36
|
},
|