[fpc-pascal] OT: Listing fpc options Was: Using a custom fpc.cfg

Tomas Hajny XHajT03 at hajny.biz
Wed Jul 9 01:01:40 CEST 2014


On Wed, July 9, 2014 00:35, johanns at nacs.net wrote:
> On Tue, Jul 08, 2014 at 01:21:07PM +0200, Tomas Hajny wrote:
>>On Tue, July 8, 2014 12:07, Mark Morgan Lloyd wrote:
>>> Tomas Hajny wrote:
>>>
>>>>> Incidentally, how does one get a list of fpc's
>>>>> options? I don't mean fpc -h  since that actually
>>>>> shows ppcXXX's options, but how does one get minimal
>>>>> info on fpc itself such as a reminder of the -V
>>>>> option?
 .
 .
>>Anyway - if you want to find out options specific to the fpc helper
>>(and/or you don't have a compiled trunk compiler readily available), you
>>can also use:
>>
>>grep -e "^F\*" < fpcsrc/compiler/msg/errore.msg  | cut -c3- |
>>sed "s/^1/-/" | sed "s/^2/ -/" | sed "s/_/   /"
>
> Yes, I should know better than to reply here on this, but
> I am fascinated by how this one line UNIX command can
> parse the error message source file and extract the option
> information.
>
> In general would it be more efficient to combine all the
> sed commands into one with multiple -e options, saving the
> extra pipes between commands, or would there be drawbacks?
>
> grep -e "^F\*" < fpcsrc/compiler/msg/errore.msg  | cut -c3- |
> sed -e "s/^1/-/" -e "s/^2/ -/" -e "s/_/   /"
>
> Apologies for being off-topic.  I am interested in what it
> is safely compatible to do across various environments in
> clever compile scripts.

<OT>Combining it would be indeed more efficient; I'm no expert on sed and
simply didn't bother to try being efficient . I don't think that there
should be any drawbacks, but I don't want to pretend to have any special
knowledge of possible differences in various sed implementations.</OT>

BTW, I just added the previously missing information about option '@' to
the help pages in trunk (together with some improvements necessary to show
this option properly).

Tomas





More information about the fpc-pascal mailing list