cli/sylow
#!/usr/bin/env node
/* eslint-env node */
/* eslint-disable newline-per-chained-call */
const program = require('commander');
const packageData = require('../package.json');
const newEntity = require('./new-entity');
const { newServer, exportServer, editServer } = require('./server');
program
.version(packageData.version)
.option('-v, --verbose', 'verbose logging');
program
.command('new-entity <name> <domain>').alias('entity')
.option('-a, --admin', 'make this an admin entity')
.action(newEntity);
program
.command('new-client [name]').alias('client')
.action();
program
.command('new-server <domain>')
.option('-u, --publickeyFile [publicKeyFile]', 'Public key file path')
.option('-r, --privatekeyFile [privateKeyFile]', 'Private key file path')
.option('-n, --name [name]', 'server\'s name')
.option('-d, --description [description]', 'server\'s description')
.action(newServer);
program
.command('export-server')
.option('-f, --file [file]', 'The target file to export to')
.action(exportServer);
program
.command('edit-server')
.option('-n, --name [name]', 'New name')
.option('-d, --domain [domain]', 'New domain')
.option('-u, --publickeyFile [publicKeyFile]', 'New public key file path')
.option('-r, --privatekeyFile [privateKeyFile]', 'New private key file path')
.action(editServer);
program
.parse(process.argv);