[cfe-dev] Adding HelpText to external flags

Raphael Isemann via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 13 22:38:51 PDT 2017


To add to this, here is a list of flags that are currently not
completed due to this: https://teemperor.de/pub/clang_lone_flags.txt

- Raphael

2017-07-13 17:34 GMT+02:00 Yuka Takahashi via cfe-dev <cfe-dev at lists.llvm.org>:
> Hello,
>
>
> I'm currently working on the bash-autocompletion project as my GSoC project,
> and I noticed that some external options (as opposed to cc1 internal
> options) lack help texts. That is inconvenient not only for users who runs
> clang with --help but for me because I'm using the following heuristics to
> determine whether my script should autocomplete an option or not (we don't
> want to autocomplete internal options):
>
> I'd like to propose to set a rule about command line options defined in
> Options.td and their help messages. My proposal is that, if an option is
> intended to be used by users, it should have a HelpText.
>
> A command line option is considered external if it
>
>
>   - has an HelpText or GroupID, and
>
>   - doesn't have NoDriverOption, Unsupported or Ignore bit,
>
>
> but the heuristic don't work quite well because some options don't have
> HelpText, such as this.
>
>
> def _sysroot_EQ : Joined<["--"], "sysroot=">;
>
>
> So I'll be adding HelpTexts to all external options, so that they look like
> this.
>
>
>  def _sysroot_EQ : Joined<["--"], "sysroot=">, HelpText<"use a given
> directory as the logical root directory for headers and libraries">;
>
>
> I believe this is in general a good thing to do, so when you add a new
> command line flag, and if that is intended to be used by users, please write
> a help message!
>
>
> Thanks,
>
> Yuka
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list