Commit d8929296 authored by Howard Chu's avatar Howard Chu
Browse files

Use lutil_progname, #include <lutil.h> to get it.

parent 89b3550f
......@@ -117,7 +117,7 @@ main( int argc, char **argv )
authmethod = -1;
prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : prog + 1;
prog = lutil_progname( "ldapcompare", argc, argv );
while (( i = getopt( argc, argv,
"Cd:D:h:H:IkKMnO:p:P:qQR:U:vw:WxX:Y:zZ")) != EOF )
......
......@@ -17,6 +17,7 @@
#include <ac/unistd.h>
#include <ldap.h>
#include "lutil.h"
#include "lutil_ldap.h"
#include "ldap_defaults.h"
......@@ -100,7 +101,7 @@ main( int argc, char **argv )
authmethod = -1;
version = -1;
prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : prog + 1;
prog = lutil_progname( "ldapdelete", argc, argv );
while (( i = getopt( argc, argv, "cf:r"
"Cd:D:h:H:IkKMnO:p:P:QR:U:vw:WxX:Y:Z" )) != EOF )
......
......@@ -29,6 +29,7 @@
#include <ldap.h>
#include "lutil.h"
#include "lutil_ldap.h"
#include "ldif.h"
#include "ldap_defaults.h"
......@@ -146,11 +147,7 @@ main( int argc, char **argv )
int rc, i, authmethod, version, want_bindpw, debug, manageDSAit, referrals;
int count, len;
if (( prog = strrchr( argv[ 0 ], *LDAP_DIRSEP )) == NULL ) {
prog = argv[ 0 ];
} else {
++prog;
}
prog = lutil_progname( "ldapmodify", argc, argv );
/* Print usage when no parameters */
if( argc < 2 ) usage( prog );
......
......@@ -29,6 +29,7 @@
#include <ac/unistd.h>
#include <ldap.h>
#include "lutil.h"
#include "lutil_ldap.h"
#include "ldap_defaults.h"
......@@ -116,7 +117,7 @@ main(int argc, char **argv)
authmethod = -1;
version = -1;
prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : prog + 1;
prog = lutil_progname( "ldapmodrdn", argc, argv );
while (( i = getopt( argc, argv, "cf:rs:"
"Cd:D:h:H:IkKMnO:p:P:QR:U:vw:WxX:Y:Z" )) != EOF )
......
......@@ -18,7 +18,7 @@
#include <ac/unistd.h>
#include <ldap.h>
#include "lutil.h"
#include "lutil_ldap.h"
#include "ldap_defaults.h"
......@@ -107,7 +107,7 @@ main( int argc, char *argv[] )
char *retoid = NULL;
struct berval *retdata = NULL;
prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : prog + 1;
prog = lutil_progname( "ldappasswd", argc, argv );
while( (i = getopt( argc, argv, "Aa:Ss:"
"Cd:D:h:H:InO:p:QR:U:vw:WxX:Y:Z" )) != EOF )
......
......@@ -194,6 +194,8 @@ main( int argc, char **argv )
debug = verbose = not = vals2tmp = referrals = valuesReturnFilter =
attrsonly = manageDSAit = ldif = want_bindpw = 0;
prog = lutil_progname( "ldapsearch", argc, argv );
lutil_log_initialize(argc, argv);
deref = sizelimit = timelimit = version = -1;
......@@ -223,8 +225,6 @@ main( int argc, char **argv )
urlize( def_urlpre );
prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : prog + 1;
while (( i = getopt( argc, argv, "Aa:b:E:F:f:Ll:S:s:T:tuz:"
"Cd:D:h:H:IkKMnO:p:P:QR:U:vw:WxX:Y:Z")) != EOF )
{
......
......@@ -18,7 +18,7 @@
#include <ac/unistd.h>
#include <ldap.h>
#include "lutil.h"
#include "lutil_ldap.h"
#include "ldap_defaults.h"
......@@ -100,7 +100,7 @@ main( int argc, char *argv[] )
char *retoid = NULL;
struct berval *retdata = NULL;
prog = (prog = strrchr(argv[0], *LDAP_DIRSEP)) == NULL ? argv[0] : prog + 1;
prog = lutil_progname( "ldapwhoami", argc, argv );
while( (i = getopt( argc, argv, "Aa:Ss:"
"Cd:D:h:H:InO:p:QR:U:vw:WxX:Y:Z" )) != EOF )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment