Boost logo

Boost Users :

Subject: [Boost-users] [program_options] Can you use position-sensitive parameters?
From: Adam Nielsen (a.nielsen_at_[hidden])
Date: 2009-01-18 02:17:59


Hi all,

I can't find anything in the docs that tells me whether this is possible
without writing custom parsers etc. so if anyone knows whether this can be
done please let me know.

I'd like to be able to use position-sensitive parameters. For example, a
program to work with .zip files:

  zip --rename=one.bin:alpha.bin --add=one.bin --rename=one.bin:beta.bin

Using this example, the initial --rename would need to be acted upon first,
before -add (otherwise one.bin would get overwritten) and likewise the last
--rename must be acted upon after -add, otherwise the wrong file (or no file)
would be renamed. If I use normal string vectors the order of the parameters
will be lost so this won't work.

Is this sort of parsing possible with program_options?

Thanks,
Adam.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net