Permalink
Browse files

Merge branch 'master' of git://github.com/cliffano/nestor

  • Loading branch information...
2 parents 30adb99 + 8741832 commit f930138a29c87143626d344610e614a64885e882 @cliffano committed Oct 17, 2011
Showing with 25 additions and 18 deletions.
  1. +3 −1 CHANGELOG.md
  2. +3 −3 README.md
  3. +19 −14 bin/nestor
View
@@ -1,6 +1,8 @@
### 0.0.2
* Add Jenkins discovery feature
* Upgrade nomnom to 1.0.0
+* Fix commands-flags association
+* Add multiple job names support for job command
### 0.0.1
-* Initial version
+* Initial version
View
@@ -29,9 +29,9 @@ View status of all jobs.
nestor dashboard
-View job status.
+View jobs status.
- nestor job jobname
+ nestor job jobname1 jobname2 ...
Trigger a build.
@@ -56,4 +56,4 @@ Discover Jenkins instance running on a host
View Jenkins version number.
nestor version
-
+
View
@@ -10,9 +10,9 @@ var DEFAULT_URL = 'http://localhost:8080',
nestor = new Nestor(service, function (err) {
console.error(err.message);
}),
- args, opts;
+ args, scriptOpts;
-opts = {
+scriptOpts = {
version: {
string: '-v',
flag: true,
@@ -23,8 +23,7 @@ opts = {
}
}
-nomnom.scriptName('nestor');
-nomnom.globalOpts(opts);
+nomnom.scriptName('nestor').opts(scriptOpts);
nomnom.command('dashboard').callback(function (args) {
nestor.dashboard(function (err, result) {
if (err) {
@@ -38,18 +37,24 @@ nomnom.command('dashboard').callback(function (args) {
}
});
});
-nomnom.command('job').callback(function (args) {
- nestor.job(args._[1], function (err, result) {
- if (err) {
- console.error(err.message);
- } else {
- console.log('Status: ' + result.status);
- result.reports.forEach(function (report) {
- console.log(report);
+nomnom.command('job')
+ .opts({
+ jobnames: { position: 1, required: true, list: true }
+ })
+ .callback(function (args) {
+ args.jobnames.forEach(function (jobname) {
+ nestor.job(jobname, function (err, result) {
+ if (err) {
+ console.error(jobname + ' - ' + err.message);
+ } else {
+ console.log(jobname + ' - ' + 'Status: ' + result.status);
+ result.reports.forEach(function (report) {
+ console.log(jobname + ' - ' + report);
+ });
+ }
});
- }
+ });
});
-});
nomnom.command('build').callback(function (args) {
nestor.build(args._[1], args._[2], function (err, result) {
if (err) {

0 comments on commit f930138

Please sign in to comment.