option group questions



Hi Glib::Option experts,

I'm currently trying to make glibmm option parsing work for me.

First goal is a program, that accepts an optional boolean option v without argument and mandatory integer and string options p and h.

Wellformed commandlines seem to work as expected:

  testprg -v -h host -p 9

But this causes problems:

  testprg -v 0 -h host -p 9
  
No complaint about 0. V is not supposed to take an argument?

  testprg -p9 

Docs indicate the space between opt and arg is mandatory. I dont like that. Is it configurable?

  testprg -v -p 9

No complaint about missing -h option. How can I define an option as mandatory?


Attached is the source of the class that should handle this.

My version of glibmm is this:
$ rpm -qa | grep glibmm
glibmm2-devel-2.12.2-11
glibmm2-2.12.2-11

$ cat /etc/SuSE-release 
openSUSE 10.2 (i586)
VERSION = 10.2

Thanks for any suggestions.

Joachim

Attachment: MainOptionGroup.h
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]