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
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Machine-readable output for scan results.
//!
//! By default the scanner prints a human-friendly, colorized report. The
//! formats here turn each result into a structured [`ScanRecord`] so the
//! scanner can act as the first stage of a pipeline (e.g. feeding a network
//! map or coverage analyzer) rather than only being read by a human.
//!
//! Machine output goes to stdout, one self-contained stream:
//! [`OutputFormat::Json`] emits a single JSON array, [`OutputFormat::Jsonl`]
//! emits one JSON object per line (JSON Lines). The progress bar stays on
//! stderr, so a consumer reading stdout sees only records.
use ValueEnum;
use Serialize;
/// How scan results are rendered to stdout.
/// One scan result in a normalized, machine-readable shape.
///
/// The fields are a superset of what a port scan and an address scan each
/// produce: `port` is present for port scans and omitted for host discovery.
/// Print all records as a single JSON array. An empty slice prints `[]`.
/// Print one JSON object per line (JSON Lines). An empty slice prints nothing.