Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parser = argparse.ArgumentParser(
description="""Wake one or more computers using the wake on lan protocol.
Note that this requires suitable configuration of the target system, and only
works within a network segment (i.e. not across routers or VPN)."""
)
parser.add_argument(
'macs',
metavar='mac addresses',
nargs='+',
help='The mac addresses or of the computers you are trying to wake, for instance 40:16:7e:ae:af:43'
)
parser.add_argument(
'-i',
metavar='ip',
default=wol.BROADCAST_IP,
help='The ip address of the host to send the magic packet to. (default {})'.format(wol.BROADCAST_IP)
)
parser.add_argument(
'-p',
metavar='port',
default=wol.DEFAULT_PORT,
help='The port of the host to send the magic packet to (default 9)'
)
args = parser.parse_args()
wol.send_magic_packet(*args.macs, ip_address=args.i, port=args.p)
parser = argparse.ArgumentParser(
description="""Wake one or more computers using the wake on lan protocol.
Note that this requires suitable configuration of the target system, and only
works within a network segment (i.e. not across routers or VPN)."""
)
parser.add_argument(
'macs',
metavar='mac addresses',
nargs='+',
help='The mac addresses or of the computers you are trying to wake, for instance 40:16:7e:ae:af:43'
)
parser.add_argument(
'-i',
metavar='ip',
default=wol.BROADCAST_IP,
help='The ip address of the host to send the magic packet to. (default {})'.format(wol.BROADCAST_IP)
)
parser.add_argument(
'-p',
metavar='port',
default=wol.DEFAULT_PORT,
help='The port of the host to send the magic packet to (default 9)'
)
args = parser.parse_args()
wol.send_magic_packet(*args.macs, ip_address=args.i, port=args.p)