CommandLine: using cl::Positional with enum

Hi Daniel,

I would like to go deeper with CommandLine and I was asking if you could
help me again.

Look, following the same example you put in the last message:

./prog <option1> | ( <option2> --arg1 --arg2) | ( <option3> --arg1 )

What I really really want is the same except I don't want the "--" prefix is
present in any of the arguments.

./prog <option1> | ( <option2> arg1 arg2) | ( <option3> arg1 )

The problem is clear: in this case, the arguments can't be optional. So I
thought to delete all the "cl:opt" and process the arguments before calling:

ClangTool Tool(OptionsParser.getCompilations(),
OptionsParser.getSourcePathList());

Oh you're using Clang stuff. I know nothing about this so I can't
really help you here.

in order to give an error if the arguments provided were not correct. But,
if arguments are correct, then the next error is shown:

warning: /home/user/clang-llvm/build/arg1: 'linker' input unused

error: unable to handle compilation, expected exactly one compiler job in ''
Error while processing /home/user/clang-llvm/build/arg1

How can I manage this? I was thinking about not calling the ClangTool
Tool(OptionsParser.getCompilations(), OptionsParser.getSourcePathList());
but, I don't know if this would be another problem. In addition, I would
have to create my own option --help, isn't it?
What do you recommend me to do?

I am considering fixing the bug in the LLVM CommandLine library but is
going to be a long time before I can look at it. So don't wait for me
to do that.

If you are really desperate to have the command line options in the
way you want they you may need to implement it yourself or use another
library (e.g. Chapter 20. Boost.Program_options - 1.53.0
).

Personally I think it's more important your tool does something rather
than spending time worrying about how it's command line interface
looks, so I would personally just implement everything as an optional
argument and then after parsing check yourself that your options have
been set as you want them.

Thanks,
Dan.