File tree 2 files changed +19
-17
lines changed
2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -85,18 +85,20 @@ As a standalone script
85
85
86
86
::
87
87
88
- usage: wakeonlan [-h] [-i ip ] [-p port ] [-n interface ] mac address [mac address ...]
88
+ usage: wakeonlan [-h] [-6] [-i IP ] [-p PORT ] [-n INTERFACE ] mac address [mac address ...]
89
89
90
90
Wake one or more computers using the wake on lan protocol.
91
91
92
92
positional arguments:
93
- mac address The mac addresses of the computers you are trying to wake.
94
-
95
- optional arguments:
96
- -h, --help show this help message and exit
97
- -i ip The ip address of the host to send the magic packet to. (default 255.255.255.255)
98
- -p port The port of the host to send the magic packet to. (default 9)
99
- -n interface The ip address of the network adapter to route the magic packet through. (optional)
93
+ mac address The mac addresses of the computers you are trying to wake.
94
+
95
+ options:
96
+ -h, --help show this help message and exit
97
+ -6, --ipv6 To indicate if ipv6 should be used by default instead of ipv4. (default: False)
98
+ -i IP, --ip IP The ip address of the host to send the magic packet to. (default: 255.255.255.255)
99
+ -p PORT, --port PORT The port of the host to send the magic packet to. (default: 9)
100
+ -n INTERFACE, --interface INTERFACE
101
+ The ip address of the network adapter to route the magic packet through. (default: None)
100
102
101
103
102
104
************
Original file line number Diff line number Diff line change @@ -102,36 +102,36 @@ def main(argv: typing.Optional[typing.List[str]] = None) -> None:
102
102
)
103
103
parser .add_argument (
104
104
'-6' ,
105
- dest = 'use_ipv6 ' ,
105
+ '--ipv6 ' ,
106
106
action = 'store_true' ,
107
107
help = 'To indicate if ipv6 should be used by default instead of ipv4.' ,
108
108
)
109
109
parser .add_argument (
110
110
'-i' ,
111
- metavar = ' ip' ,
111
+ '-- ip' ,
112
112
default = BROADCAST_IP ,
113
113
help = 'The ip address of the host to send the magic packet to.' ,
114
114
)
115
115
parser .add_argument (
116
116
'-p' ,
117
- metavar = ' port' ,
117
+ '-- port' ,
118
118
type = int ,
119
119
default = DEFAULT_PORT ,
120
120
help = 'The port of the host to send the magic packet to.' ,
121
121
)
122
122
parser .add_argument (
123
123
'-n' ,
124
- metavar = 'interface' ,
125
- default = None ,
124
+ '--interface' ,
126
125
help = 'The ip address of the network adapter to route the magic packet through.' ,
127
126
)
128
127
args = parser .parse_args (argv )
128
+ print (args )
129
129
send_magic_packet (
130
130
* args .macs ,
131
- ip_address = args .i ,
132
- port = args .p ,
133
- interface = args .n ,
134
- address_family = socket .AF_INET6 if args .use_ipv6 else None ,
131
+ ip_address = args .ip ,
132
+ port = args .port ,
133
+ interface = args .interface ,
134
+ address_family = socket .AF_INET6 if args .ipv6 else None ,
135
135
)
136
136
137
137
You can’t perform that action at this time.
0 commit comments