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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.