summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Weller <git@max-weller.de>2014-02-17 10:14:02 +0100
committerMax Weller <git@max-weller.de>2014-02-17 10:14:02 +0100
commite9f4de694616a137216dc00f648e0001c5dc202a (patch)
treeb27088eb7dbbfa48234c9463ffffae6482354dfe
parenta0316461bda85882821a1777a88953797f78292c (diff)
downloadMAC-Telnet-e9f4de694616a137216dc00f648e0001c5dc202a.tar.gz
MAC-Telnet-e9f4de694616a137216dc00f648e0001c5dc202a.zip
Changed the usage message to match the required parameter order.
(getopt on Mac OS might be stricter than Linux getopt?)
-rw-r--r--mactelnet.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mactelnet.c b/mactelnet.c
index d61ea05..cf2889d 100644
--- a/mactelnet.c
+++ b/mactelnet.c
@@ -256,13 +256,11 @@ int main (int argc, char **argv) {
unsigned char devicename[30];
unsigned char printHelp = 0, haveUsername = 0, havePassword = 0;
int c;
-
while (1) {
c = getopt(argc, argv, "nu:p:h?");
if (c == -1)
break;
-
switch (c) {
case 'n':
@@ -291,19 +289,19 @@ int main (int argc, char **argv) {
}
}
if (argc - optind < 2 || printHelp) {
- fprintf(stderr, "Usage: %s <ifname> <MAC|identity> [-h] [-n] [-u <username>] [-p <password>]\n", argv[0]);
+ fprintf(stderr, "Usage: %s [-h] [-n] [-u <username>] [-p <password>] <ifname> <MAC|identity>\n", argv[0]);
if (printHelp) {
fprintf(stderr, "\nParameters:\n");
- fprintf(stderr, " ifname Network interface that the RouterOS resides on. (example: eth0)\n");
- fprintf(stderr, " MAC MAC-Address of the RouterOS device. Use mndp to discover them.\n");
- fprintf(stderr, " identity The identity/name of your RouterOS device. Uses MNDP protocol to find it.\n");
#ifndef __APPLE_CC__
fprintf(stderr, " -n Do not use broadcast packets. Less insecure but requires root privileges.\n");
#endif
fprintf(stderr, " -u Specify username on command line.\n");
fprintf(stderr, " -p Specify password on command line.\n");
fprintf(stderr, " -h This help.\n");
+ fprintf(stderr, " ifname Network interface that the RouterOS resides on. (example: eth0)\n");
+ fprintf(stderr, " MAC MAC-Address of the RouterOS device. Use mndp to discover them.\n");
+ fprintf(stderr, " identity The identity/name of your RouterOS device. Uses MNDP protocol to find it.\n");
fprintf(stderr, "\n");
}
return 1;