switch to getarg directly
This commit is contained in:
@@ -117,22 +117,21 @@ main (int argc, char **argv)
|
|||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
krb5_context context;
|
krb5_context context;
|
||||||
krb5_principal principal;
|
krb5_principal principal;
|
||||||
int optind = 0;
|
|
||||||
krb5_get_init_creds_opt *opt;
|
krb5_get_init_creds_opt *opt;
|
||||||
krb5_ccache id = NULL;
|
krb5_ccache id = NULL;
|
||||||
int exit_value;
|
int exit_value;
|
||||||
|
int optidx = 0;
|
||||||
|
|
||||||
optind = krb5_program_setup(&context, argc, argv,
|
setprogname(argv[0]);
|
||||||
args, sizeof(args) / sizeof(args[0]), usage);
|
|
||||||
|
|
||||||
|
if(getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, &optidx))
|
||||||
|
usage(1, args, sizeof(args) / sizeof(args[0]));
|
||||||
if (help_flag)
|
if (help_flag)
|
||||||
usage (0, args, sizeof(args) / sizeof(args[0]));
|
usage(0, args, sizeof(args) / sizeof(args[0]));
|
||||||
|
if (version_flag) {
|
||||||
if(version_flag){
|
print_version(NULL);
|
||||||
print_version (NULL);
|
return 0;
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user