Skip to content

Commit

Permalink
add list command
Browse files Browse the repository at this point in the history
  • Loading branch information
hubermat committed Jul 28, 2018
1 parent 0436e6b commit 33520fa
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion changeConfig.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
var fs = require('fs')
, ini = require('ini');

if ((process.argv.length < 3) || ((process.argv[2] === 'add') && (process.argv.length < 8))) {
if ((process.argv.length < 3) || (process.argv[2] === 'list') || ((process.argv[2] === 'add') && (process.argv.length < 8))) {
console.log('Usage:');
console.log(' node changeConfig.js add <sitename> <uri> <password> <api-user> <api-password> [<comment>]');
console.log(' node changeConfig.js remove <sitename>');
console.log(' node changeConfig.js show <sitename>');
console.log(' node changeConfig.js list');
return;
}

Expand Down Expand Up @@ -34,6 +35,14 @@ if (command === 'show') {
return;
}

if (command === 'list') {
console.log('Configured LDAP sites:');
Object.keys(config.sites).forEach(function (key) {
console.log(key);
});
}


if (command === 'remove') {
delete config.sites[sitename];
console.log('Deleting config for site '+sitename+' ...');
Expand Down

0 comments on commit 33520fa

Please sign in to comment.