summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHåkon Nessjøen <haakon.nessjoen@gmail.com>2014-02-18 05:29:02 +0100
committerHåkon Nessjøen <haakon.nessjoen@gmail.com>2014-02-18 05:29:02 +0100
commit00c88c6396bc245eaa8023c9fe7c56809c098d96 (patch)
treeb27088eb7dbbfa48234c9463ffffae6482354dfe
parenta0316461bda85882821a1777a88953797f78292c (diff)
parente9f4de694616a137216dc00f648e0001c5dc202a (diff)
downloadMAC-Telnet-mactelnet-osx.tar.gz
MAC-Telnet-mactelnet-osx.zip
Merge pull request #8 from max-weller/mactelnet-osxmactelnet-osx
Changed the usage message to match the required parameter order.
-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;