954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

MySQL C API handle_options

Hello,

I am using the handle_options function in a client program written in C that is using the MySQL API. Considering there is no actual reference to this function (to my knowledge) except the book 'MySQL' (or something) written by DuBois, I'm asking for help here.

So I want to process some command line arguments that aren't mysql options. The problem is, they arguments are going to sometimes be negative numbers. The dash (-) representing the negative number gets recognised by handle_options as a mysql option and I then receive the following error message in console.

unknown option '-2'


Anyone know any way to tell handle_options to only look for the options that I have defined in my my_option struct and to leave everything else prefixed with a '-' alone? Or will I have to resort to using a different symbol to represent a negative number for the command line arguments :(

Cheers.

Blasz
Newbie Poster
2 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

Hi,

Try having your application processes argv and argc, and remove those options before passing them to the library. The options processing code is a minefield! :)

For help help with your MySQL database, visit www.skysql.com

Cheers!

Kath

kathoneil27
Newbie Poster
1 post since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: