caesar-cipher-amine
Version:
Implementation of caesar cipher
25 lines (19 loc) • 460 B
JavaScript
var commander = require('commander');
// caeser cipher methode
var caesar = require('./caesarMethode')
// managing the command lines
var textValue;
commander
.arguments('<text>')
.option('-d, --integer <n>' , "Right shift" , parseInt)
.action(function (text , n) {
textValue = text;
})
commander.parse(process.argv);
var dec = commander.integer;
try {
caesar(textValue , dec);
}
catch(e){
console.error(e.toString());
}