-
Notifications
You must be signed in to change notification settings - Fork 4
/
cli.js
44 lines (42 loc) · 966 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env node
/* eslint-env node */
/* eslint-disable no-console, no-implicit-globals */
//
// Imports
//
var yargs = require("yargs");
var SaltThePass = require("./src/saltthepass");
var hashes = SaltThePass.getHashes();
//
// Command-line args
//
var argv = yargs
.option("hash", {
alias: "h",
desc: "Name of the hash, e.g. md5",
default: "md5",
choices: hashes,
requiresArg: true
})
.option("password", {
alias: "p",
desc: "Master Password",
demandOption: true,
requiresArg: true
})
.option("domain", {
alias: "d",
desc: "Domain Name",
demandOption: true,
requiresArg: true
})
.option("phrase", {
alias: "r",
desc: "Domain phrase",
requiresArg: true
})
.help()
.strict()
.version()
.argv;
console.log(SaltThePass.saltthepass(argv.hash, argv.password, argv.domain, argv.phrase));