]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/ftest.c
fix non-printable flag detection; improve dn test (passes all but last in http:/...
[openldap] / libraries / libldap / ftest.c
index 6f9a227a18f503febf6aaf52dc594c0bdd0f4fe0..8fda498e38d62bf8bc0359520e44b45b6a47a815 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /* OpenLDAP Filter API Test */
@@ -27,19 +27,21 @@ static int filter2ber( char *filter );
 int usage()
 {
        fprintf( stderr, "usage:\n"
-               "\tftest [-d n] filter\n" );
+               "  ftest [-d n] filter\n"
+               "    filter - RFC 2254 string representation of an "
+                       "LDAP search filter\n" );
        return EXIT_FAILURE;
 }
 
 int
 main( int argc, char *argv[] )
 {
-       int i;
+       int c;
        int debug=0;
        char *filter=NULL;
 
-    while( (i = getopt( argc, argv, "Aa:Ss:" "d:" )) != EOF ) {
-               switch ( i ) {
+    while( (c = getopt( argc, argv, "d:" )) != EOF ) {
+               switch ( c ) {
                case 'd':
                        debug = atoi( optarg );
                        break;
@@ -65,10 +67,7 @@ main( int argc, char *argv[] )
                }
        }
 
-       if( argc - optind > 1 ) {
-               return usage();
-
-       } else if ( argc - optind != 1 ) {
+       if ( argc - optind != 1 ) {
                return usage();
        }