qa-control 0.5.0-rc.0 → 0.5.0

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  "use strict";
4
4
 
5
- var program = require('commander');
5
+ var { program } = require('commander');
6
6
  var qaControl = require('./qa-control');
7
7
  var qacInit = require('./qac-init');
8
8
  var fs = require('fs-promise');
@@ -10,6 +10,7 @@ var path = require('path');
10
10
 
11
11
  program
12
12
  .version(require('../package').version)
13
+ .argument('[projectDirectory]', 'Project directory to check')
13
14
  .usage('[[options] projectDirectory|--list-langs]')
14
15
  .option('-l, --lang [lang]', 'Language to generate')
15
16
  .option('-v, --verbose', 'Show progress information')
@@ -17,30 +18,32 @@ program
17
18
  .option('-c, --cucardas', 'Always generate cucardas.log')
18
19
  .option('-i, --init', 'Initialize project with qa-control specs')
19
20
  .parse(process.argv);
20
-
21
- if( ( !program.init && !program.listLangs && (""==program.args && !program.projectDir))
22
- || (program.lang && false === program.lang in qaControl.msgs) )
21
+
22
+ var opts = program.opts();
23
+
24
+ if( ( !opts.init && !opts.listLangs && (""==program.args && !opts.projectDir))
25
+ || (opts.lang && false === opts.lang in qaControl.msgs) )
23
26
  {
24
27
  program.help();
25
28
  }
26
29
 
27
30
  var params = {};
28
31
  params.projectDir = program.args[0];
29
- params.verbose = program.verbose;
30
- params.listLangs = program.listLangs;
31
- params.lang = program.lang;
32
- params.cucardas = program.cucardas;
33
- // console.log(program); process.exit(0);
32
+ params.verbose = opts.verbose;
33
+ params.listLangs = opts.listLangs;
34
+ params.lang = opts.lang;
35
+ params.cucardas = opts.cucardas;
36
+ // console.log(opts); process.exit(0);
34
37
  // console.log(params); process.exit(0);
35
38
 
36
- var msgs = (program.init ? qacInit.cmdMsgs : qaControl.cmdMsgs)[params.lang || 'en'];
39
+ var msgs = (opts.init ? qacInit.cmdMsgs : qaControl.cmdMsgs)[params.lang || 'en'];
37
40
 
38
41
  function printErr(err) {
39
42
  process.stderr.write("\nERROR: "+err.message);
40
43
  process.stderr.write("\nSTACK: "+err.stack);
41
44
  }
42
45
 
43
- if(program.init) {
46
+ if(opts.init) {
44
47
  process.stdout.write(msgs.msg_initializing+"\n");
45
48
  params.verbose = true;
46
49
  qacInit.init(params).then(function() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qa-control",
3
3
  "description": "QA control of things that nobody controls",
4
- "version": "0.5.0-rc.0",
4
+ "version": "0.5.0",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/qa-control",