src/ros.c: Add options and versioning information to usage output.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Fri, 25 Dec 2009 10:44:21 +0000 (11:44 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Fri, 25 Dec 2009 10:44:21 +0000 (11:44 +0100)
src/ros.c

index 6d38b27..bcd72de 100644 (file)
--- a/src/ros.c
+++ b/src/ros.c
@@ -272,7 +272,19 @@ static char *read_password (void) /* {{{ */
 
 static void exit_usage (void) /* {{{ */
 {
-       printf ("Usage: ros [options] <host> <command> [args]\n");
+       printf ("Usage: ros [options] <host> <command> [args]\n"
+                       "\n"
+                       "OPTIONS:\n"
+                       "  -u <user>       Use <user> to authenticate.\n"
+                       "  -h              Display this help message.\n"
+                       "\n");
+       if (ros_version () == ROS_VERSION)
+               printf ("Using librouteros %s\n", ROS_VERSION_STRING);
+       else
+               printf ("Using librouteros %s (%s)\n",
+                               ros_version_string (), ROS_VERSION_STRING);
+       printf ("Copyright (c) 2009 by Florian Forster\n");
+
        exit (EXIT_SUCCESS);
 } /* }}} void exit_usage */