-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsslinfo-cli.js
More file actions
executable file
·39 lines (34 loc) · 1.05 KB
/
sslinfo-cli.js
File metadata and controls
executable file
·39 lines (34 loc) · 1.05 KB
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
#!/usr/bin/env node
const program = require('commander');
const packageJson = require('./package');
const inquirer = require('inquirer');
const sslInfoWrapper = require('./lib/sslinfo-wrapper');
program
.version(packageJson.version)
.option('-h, --host [www.example.com]', 'Provide the hostname that you are looking for')
.option('-p, --port [443]', 'Provide the port that the connection is made')
.parse(process.argv)
var host = program.host;
var port = program.port || 443;
if (!host) {
var questions = [
{
type: 'input',
name: 'host',
message: "Provide the hostname that you are looking for?"
},
{
type: 'input',
name: 'port',
message: "Provide the port that the connection is made?",
default: port
}];
inquirer.prompt(questions).then(answers => {
// log(JSON.stringify(answers, null, ' '));
host = answers.host;
port = answers.port;
sslInfoWrapper.process(host, port);
});
} else {
sslInfoWrapper.process(host, port);
}