-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiscover.py
More file actions
34 lines (24 loc) · 700 Bytes
/
Copy pathdiscover.py
File metadata and controls
34 lines (24 loc) · 700 Bytes
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
#!/usr/bin/env python3
"""
Discover Command: Used to discover a subnet or a specific device
Usage:
python main.py discover --help
python main.py discover subnet 10.1.1.0/24
python main.py discover device chi-leaf-04
"""
from typer import Typer, echo
app = Typer(short_help="discover a subnet or a device")
@app.command("subnet")
def discover_subnet(
subnet: str,
) -> None:
"""Discover devices on a subnet"""
echo(f"Discovering Devices on subnet: {subnet}")
@app.command("device")
def discover_device(
device: str,
) -> None:
"""Discover a specific device"""
echo(f"Discovering Device: {device}")
if __name__ == "__main__":
app()