@libit/sn-cli
Version:
The sn command line tool
31 lines • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cli = void 0;
require("./globalize");
const core_1 = require("@caporal/core");
const sn_1 = require("@libit/sn");
const g = require('strong-globalize')();
const pkg = require('../package.json');
async function cli(argv) {
core_1.program
.version(pkg.version)
.description(g.f('Retrieve the serial number of the local machine.'))
.option('-c, --cwd <cwd>', g.f('The custom current working directory'))
.option('-f, --file <file>', g.f('The custom cache file name'))
.option('-p, --prefix <prefix>', g.f('A string to be prefixed ahead of the shell command to be run'))
.option('-u, --uuid', g.f('Prefer to retrieve uuid on the first attempt'))
.option('-d, --hash', g.f('Retrieve the hashed serial number'))
.option('-s, --size <size>', g.f('Slice the serial number to specified size'))
.action(async ({ options }) => {
console.log(await sn_1.sn(Object.assign({}, options)));
});
await core_1.program.run(argv);
}
exports.cli = cli;
if (require.main === module) {
cli(process.argv.slice(2)).catch(err => {
console.error(err.message);
process.exit(1);
});
}
//# sourceMappingURL=cli.js.map