<div dir="ltr"><div>For what it's worth (and that is probably not a whole lot! ;) ), I'm using cl::opt in my Pascal compiler. I can't say I've done extensive work with it, but it's "doing the job for what I need". <br><br>For reference:<br><a href="https://github.com/Leporacanthicus/lacsap/blob/master/lacsap.cpp#L35">https://github.com/Leporacanthicus/lacsap/blob/master/lacsap.cpp#L35</a><br><br>--<br></div>Mats<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 April 2016 at 08:08, Sean Silva via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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">libOption's key feature is being able implement command line parsing compatible with basically any program under the sun. For example, you have control over distinguishing between `-foo` and `--foo` if you need that. <div>It is used in clang for command line parsing compatible cl.exe and gcc.</div><div>In LLD it is used for command line option parsing compatible with link.exe, gnu ld, and ld64.<div><div>If you're writing a program from scratch, this is probably too heavyweight and not the right choice (e.g. it involves running a TableGen step as part of your build).<div><br></div><div>On the other hand, cl::opt has its oddities. But overall cl::opt is a reasonable basic option parsing library I would say. If you just need some basic option parsing, already have LLVM as a dependency, and don't want to roll your own option parsing, it is probably a decent choice.</div><div><br></div><div>Overall I would not consider LLVM to provide a general purpose "option parsing" solution. But cl::opt is the closest thing we have.<br><div><br></div><div>-- Sean Silva</div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Apr 19, 2016 at 5:47 AM, Russell Wallace via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><div dir="ltr">I'm given to understand that the recommendation these days is to use libOption instead of cl::opt, on the grounds that it has a number of advantages including more control of which options are made available.<div><br></div><div>Is there any information available on how to use libOption, any documentation or example programs? Do any existing programs use it except the clang driver programs? Those customise their commandline handling heavily enough that it's hard to use them as examples.</div></div>
<br></span><span class="">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></span></blockquote></div><br></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>