labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r744643 - /labs/orthrus/trunk/src/ui/ortcalc/ortcalc.c
Date Sun, 15 Feb 2009 09:52:28 GMT
Author: pquerna
Date: Sun Feb 15 09:52:28 2009
New Revision: 744643

URL: http://svn.apache.org/viewvc?rev=744643&view=rev
Log:
Add -H option, to print the reply in hex instead of words

Modified:
    labs/orthrus/trunk/src/ui/ortcalc/ortcalc.c

Modified: labs/orthrus/trunk/src/ui/ortcalc/ortcalc.c
URL: http://svn.apache.org/viewvc/labs/orthrus/trunk/src/ui/ortcalc/ortcalc.c?rev=744643&r1=744642&r2=744643&view=diff
==============================================================================
--- labs/orthrus/trunk/src/ui/ortcalc/ortcalc.c (original)
+++ labs/orthrus/trunk/src/ui/ortcalc/ortcalc.c Sun Feb 15 09:52:28 2009
@@ -66,10 +66,11 @@
 {
   apr_file_printf(oc->errfile,
     "%s -- Program to calculate OTP responses" NL
-    "Usage: %s [-Vh] [sequence] [seed]"
+    "Usage: %s [-VhH] [sequence] [seed]"
     ""NL
     "   -V   Print version information and exit." NL
-    "   -h   Print help text and exit." NL
+    "   -h   Print help text and exit." NL NL
+    "   -H   Output Hex Response" NL
     ""NL,
     oc->shortname,
     oc->shortname);
@@ -135,7 +136,7 @@
   
   opt->interleave = 1;
   
-  while ((rv = apr_getopt(opt, "Vvh", &ch, &optarg)) == APR_SUCCESS) {
+  while ((rv = apr_getopt(opt, "VhH", &ch, &optarg)) == APR_SUCCESS) {
     switch (ch) {
       case 'V':
         apr_file_printf(oc.outfile, "%s %s" NL, oc.shortname, ORTHRUS_VERSION_STRING);
@@ -143,6 +144,8 @@
       case 'h':
         usage(&oc);
         return 0;
+      case 'H':
+        oc.showhex = 1;
     }
   }
   
@@ -181,7 +184,7 @@
   else {
     const char *output;
 
-    if (oc.showhex || 1) {
+    if (oc.showhex) {
       orthrus_response_format_hex(reply, &output);
     }
     else {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message