Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - ApOptions in PhAB Application: (7 Items)
   
ApOptions in PhAB Application  
According to the documentation, I should be able to add command line options to the ApOptions array. I have:

/* Application Options string */
const char ApOptions[] =
	AB_OPTIONS "vo:mVP:C:"; /* Add your options in the "" */

Yet when I invoke my app with arguments "-P path", ApInitialize() terminates with the error "Unrecognized option: '-P'"

Any idea if there is a workaround for this?
Re: ApOptions in PhAB Application  
I may be beyond my understanding, but it looks to me as though there is an ApOptions variable in libAp.so, so there may 
be a linking issue where ApInitialize() sees the copy in the library, not the ApOptions in my program. 
Re: ApOptions in PhAB Application  
This works for me. 
Are you sure that it is the ApInitialize() that reports this problem?
Can you make a small sample app that shows this problem?
Re: ApOptions in PhAB Application  
Misha Nefedov wrote:
> This works for me. 
> Are you sure that it is the ApInitialize() that reports this problem?
>   
Yes, I traced it in the debugger.
> Can you make a small sample app that shows this problem?
>   
I'll try.
Re: ApOptions in PhAB Application  
OK, no, my small test program does not exhibit the same symptom. Instead it will not complain even if I give it invalid 
options. In the attached, I have specified:

/* Application Options string */
const char ApOptions[] =
  AB_OPTIONS ""; /* Add your options in the "" */

and in mysetup() I just dump the command line and the ApOptions array. The output of a run with bogus options gives me:

mysetup(4, 'ApOptions_gnort124154077390614', '-P', 'path', '-X'
ApOptions[] = "s:"
Attachment: Compressed file ApOptions.zip 41.32 KB
Re: ApOptions in PhAB Application  
The debugger fooled me. It terminated while stepping over ApInitialize(), but in fact it went on to execute the 
following function call. I guess ApInitialize() never complains about arguments it doesn't recognize.
Re: ApOptions in PhAB Application  
You are right. ApInitialize() doesn't complain about errors.