Adding HelpText to external flags

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding HelpText to external flags

Romanenkov Kirill via cfe-dev
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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Adding HelpText to external flags

Romanenkov Kirill via cfe-dev
> 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!

My 2 cents. Usually people are easy to forget writing something which
is not mandatory requirement.
Do you think it's possible to code down the rule, so that if HelpText
is missing for options used by user,
the code won't compile, or at least give some warning?

Regards,
chenwj

--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Adding HelpText to external flags

Romanenkov Kirill via cfe-dev
In reply to this post by Romanenkov Kirill via cfe-dev
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 <[hidden email]>:

> 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
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Adding HelpText to external flags

Romanenkov Kirill via cfe-dev
-fheinous-gnu-extensions   :)

On Fri, Jul 14, 2017 at 7:38 AM, Raphael Isemann via cfe-dev
<[hidden email]> wrote:

> 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 <[hidden email]>:
>> 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
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



--
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Adding HelpText to external flags

Romanenkov Kirill via cfe-dev
In reply to this post by Romanenkov Kirill via cfe-dev
I forgot to note that this list might be incomplet and incorrekt. It's
just grepped from the tablegen files.

- Raphael

2017-07-14 7:38 GMT+02:00 Raphael Isemann <[hidden email]>:

> 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 <[hidden email]>:
>> 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
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev