MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / main

Function main

pager_lib/getmac/__main__.py:13–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12
13def main(): # type: () -> None
14 parser = argparse.ArgumentParser(
15 "getmac",
16 description="Get the MAC address of system network "
17 "interfaces or remote hosts on the LAN",
18 )
19 parser.add_argument(
20 "--version", action="version", version="getmac %s" % getmac.__version__
21 )
22 parser.add_argument(
23 "-v", "--verbose", action="store_true", help="Enable output messages"
24 )
25 parser.add_argument(
26 "-d",
27 "--debug",
28 action="count",
29 help="Enable debugging output. Add characters to "
30 "increase verbosity of output, e.g. '-dd'.",
31 )
32 parser.add_argument(
33 "-N",
34 "--no-net",
35 "--no-network-requests",
36 action="store_true",
37 dest="NO_NET",
38 help="Do not use arping or send a UDP packet to refresh the ARP table",
39 )
40 parser.add_argument(
41 "--override-port",
42 type=int,
43 metavar="PORT",
44 help="Override the default UDP port used to refresh the ARP table "
45 "if network requests are enabled and arping is unavailable",
46 )
47 parser.add_argument(
48 "--override-platform",
49 type=str,
50 default=None,
51 metavar="PLATFORM",
52 help="Override the platform detection with the given value "
53 "(e.g. 'linux', 'windows', 'freebsd', etc.'). "
54 "Any values returned by platform.system() are valid.",
55 )
56 parser.add_argument(
57 "--force-method",
58 type=str,
59 default=None,
60 metavar="METHOD",
61 help="Force a specific method to be used, e.g. 'IpNeighborShow'. "
62 "This will be used regardless of it's method type or platform "
63 "compatibility, and Method.test() will NOT be checked!",
64 )
65
66 group = parser.add_mutually_exclusive_group(required=False)
67 group.add_argument(
68 "-i",
69 "--interface",
70 type=str,

Callers 2

__main__.pyFile · 0.90
__main__.pyFile · 0.70

Calls 3

debugMethod · 0.80
get_mac_addressMethod · 0.80
exitMethod · 0.80

Tested by

no test coverage detected