<div dir="ltr">Ah, figured it out, just placing this code:<div><br></div><div>static llvm::cl::opt<std::string> OutputPath(<br></div><div><div>      "o", llvm::cl::desc("Output file"), llvm::cl::Optional);</div>
</div><div><br></div><div style>before calling:</div><div style><br></div><div style>CommonOptionsParser parser( argc, argv );<br></div><div style><br></div><div style>on my tool does some static black magic that automagically adds the option to the application.</div>
<div style><br></div><div style>Thanks,</div><div style><br></div><div style>Victor</div><div style><br></div><div style><br></div><div style><br></div><div style><br></div><div style><br></div><div><br></div><div><br></div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/1/5 Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default">Take a look at the class comment in</div><div class="gmail_default">llvm/tools/clang/include/clang/Tooling/CommonOptionsParser.h<br>
</div><div class="gmail_default">
<br></div><div class="gmail_default">If something doesn't work as described there (or if we can make it clearer) let me know :)</div><div class="gmail_default"><br></div><div class="gmail_default">Cheers,</div>
<div class="gmail_default">/Manuel</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jan 5, 2013 at 9:10 PM, Victor Vicente de Carvalho <span dir="ltr"><<a href="mailto:victor.v.carvalho@gmail.com" target="_blank">victor.v.carvalho@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Manuel,<div><br></div><div>Haha, yes, It's exactly what I'm intending to do. The problem is that CommonOptionsParser calls cl::ParseCommandLineOptions(argc, argv) and I was trying to figure on how to inject custom arguments inside it.</div>


<div><br></div><div><br></div><div>Cheers,</div><div><br></div><div>Victor</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/1/5 Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_default">On Sat, Jan 5, 2013 at 8:10 PM, Victor Vicente de Carvalho <span dir="ltr"><<a href="mailto:victor.v.carvalho@gmail.com" target="_blank">victor.v.carvalho@gmail.com</a>></span> wrote:<br>



</div></div><div class="gmail_extra"><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>
I would like to expand CommonOptionsParser class with a new argument to specify an output file (something like -o "generated.cpp"). What would be the best way to do that?</div>
</div></blockquote><div><br></div></div><div>As this sounds like something that is not common to pretty much all tools, I'd say - put it into the actual tool you're writing?</div><div><br></div><div>Cheers,</div>



<div>/Manuel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
</div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>