-
Notifications
You must be signed in to change notification settings - Fork 14
/
common.ts
121 lines (115 loc) · 2.92 KB
/
common.ts
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/**
* Global options for all commands.
* @category Interfaces
*/
export interface GlobalOptions {
/** @hidden */
[index: string]: boolean | string | undefined;
/**
* When provided, will prepend the command with `sudo`, which effectively instructs
* the OS to execute the command with elevated privileges.
*/
sudo?: boolean;
/**
* If set, the command won't be executed, just the command line will be built.
* Useful for debugging since the command will return a Command class, which provides access
* to Command.cmdToExec for debugging.
*/
dryRun?: boolean;
/** Required for certain commands that need a file path to create a file or consume it. */
filePath?: string;
/** Required for certain commands that need `stdin` input. */
stdin?: string;
/**
* Shortcut for `-family inet`.
*
* @remarks
* Specifies the protocol family to use.
*/
'-4'?: true;
/**
* Shortcut for `-family inet6`.
*
* @remarks
* Specifies the protocol family to use.
*/
'-6'?: true;
/**
* Shortcut for `-family bridge`.
*
* @remarks
* Specifies the protocol family to use.
*/
'-B'?: true;
/**
* Shortcut for `-family mpls`.
*
* @remarks
* Specifies the protocol family to use.
*/
'-M'?: true;
/**
* Shortcut for `-family link`.
*
* @remarks
* Specifies the protocol family to use.
*/
'-0'?: true;
/**
* Output more detailed information.
* @hidden
*/
'-details'?: true;
/**
* Output more information.
* @hidden
*/
'-statistics'?: true;
/**
* Output results in JavaScript Object Notation (JSON).
* @hidden
*/
'-json'?: true;
/**
* Used in `ip monitor`.
* Prints short timestamp before the event message on the same line in format:
* `[<YYYY>-<MM>-<DD>T<hh:mm:ss>.<ms>] <EVENT>`
* @hidden
*/
'-tshort'?: true;
/**
* Output each record on a single line, replacing line feeds with the '\' character.
* This is convenient when you want to count records with `wc(1)` or to `grep(1)` the output.
* Used in `ip monitor`.
* Prints short timestamp before the event message on the same line in format:
* `[<YYYY>-<MM>-<DD>T<hh:mm:ss>.<ms>] <EVENT>`
* @hidden
*/
'-oneline'?: true;
}
/**
* An empty interface.
* @category Interfaces
*/
export interface Empty {
}
/**
* Global options with required file path.
* @category Interfaces
*/
export type FilePathRequiredGlobalOption = Required<Pick<GlobalOptions, 'filePath'>>;
/**
* Global options with required file path.
* @category Interfaces
*/
export type GlobalOptionsWithRequiredFilePath = GlobalOptions & FilePathRequiredGlobalOption;
/**
* Global options with required stdin.
* @category Interfaces
*/
export type StdinRequiredGlobalOption = Required<Pick<GlobalOptions, 'stdin'>>;
/**
* Global options with required stdin.
* @category Interfaces
*/
export type GlobalOptionsWithRequiredStdin = GlobalOptions & StdinRequiredGlobalOption;