1 // Test the ACE_Get_Opt class.
3 #include "ace/OS_main.h"
4 #include "ace/Get_Opt.h"
5 #include "ace/Log_Msg.h"
9 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
11 ACE_Get_Opt
get_opt (argc
, argv
, ACE_TEXT("ab:cd:ef:gh:"));
14 while ((c
= get_opt ()) != EOF
)
18 ACE_DEBUG ((LM_DEBUG
, "got a\n"));
21 ACE_DEBUG ((LM_DEBUG
, "got b with arg %s\n", get_opt
.opt_arg ()));
24 ACE_DEBUG ((LM_DEBUG
, "got c\n"));
27 ACE_DEBUG ((LM_DEBUG
, "got d with arg %s\n", get_opt
.opt_arg ()));
30 ACE_DEBUG ((LM_DEBUG
, "got e\n"));
33 ACE_DEBUG ((LM_DEBUG
, "got f with arg %s\n", get_opt
.opt_arg ()));
36 ACE_DEBUG ((LM_DEBUG
, "got g\n"));
39 ACE_DEBUG ((LM_DEBUG
, "got h with arg %s\n", get_opt
.opt_arg ()));
42 ACE_DEBUG ((LM_DEBUG
, "got %c, which is unrecognized!\n", c
));
46 for (int i
= get_opt
.opt_ind (); i
< argc
; i
++)
47 ACE_DEBUG ((LM_DEBUG
, "optind = %d, argv[optind] = %s\n",