|
1 | 1 | r"""jc - JSON Convert `route print` command output parser |
2 | 2 |
|
| 3 | +See also: the `route` command parser |
| 4 | +
|
3 | 5 | Usage (cli): |
4 | 6 |
|
5 | 7 | $ route print | jc --route-print |
|
26 | 28 | "netmask": string, |
27 | 29 | "gateway": string, |
28 | 30 | "interface": string, |
29 | | - "metric": integer, |
30 | | - "metric_set_to_default": boolean # if metric="Default" |
| 31 | + "metric": integer, # [0] |
| 32 | + "metric_set_to_default": boolean # [1] |
31 | 33 | } |
32 | 34 | ], |
33 | 35 | "persistent_routes": [ |
34 | 36 | { |
35 | 37 | "network_address": string, |
36 | 38 | "netmask": string, |
37 | 39 | "gateway_address": string, |
38 | | - "metric": integer |
39 | | - "metric_set_to_default": boolean # if metric="Default" |
| 40 | + "metric": integer # [0] |
| 41 | + "metric_set_to_default": boolean # [1] |
40 | 42 | } |
41 | 43 | ] |
42 | 44 | }, |
43 | 45 | "ipv6_route_table": { |
44 | 46 | "active_routes": [ |
45 | 47 | { |
46 | 48 | "interface": integer, |
47 | | - "metric": integer, |
48 | | - "metric_set_to_default": boolean, # if metric="Default" |
| 49 | + "metric": integer, # [0] |
| 50 | + "metric_set_to_default": boolean, # [1] |
49 | 51 | "network_destination": string, |
50 | 52 | "gateway": string |
51 | 53 | } |
52 | 54 | ], |
53 | 55 | "persistent_routes": [ |
54 | 56 | { |
55 | 57 | "interface": integer, |
56 | | - "metric": integer, |
57 | | - "metric_set_to_default": boolean, # if metric="Default" |
| 58 | + "metric": integer, # [0] |
| 59 | + "metric_set_to_default": boolean, # [1] |
58 | 60 | "network_destination": string, |
59 | 61 | "gateway": string |
60 | 62 | } |
61 | 63 | ] |
62 | 64 | } |
63 | 65 | } |
64 | 66 |
|
| 67 | + [0] Null/None if "metric" = "Default" |
| 68 | + [1] True if "metric" = "Default" |
| 69 | +
|
65 | 70 | Examples: |
66 | 71 |
|
67 | 72 | $ route print | jc --route-print -p |
|
173 | 178 | class info(): |
174 | 179 | """Provides parser metadata (version, author, etc.)""" |
175 | 180 | version = '1.0' |
176 | | - description = '`route-print` command parser' |
| 181 | + description = '`route print` command parser' |
177 | 182 | author = 'joehacksalot' |
178 | 183 | author_email = 'joehacksalot@gmail.com' |
| 184 | + details = 'See also: `route` command parser' |
179 | 185 | compatible = ['win32'] |
180 | 186 | magic_commands = ['route print'] |
181 | 187 | tags = ['command'] |
|
0 commit comments