Pergunta

In my C program I have a dedicated translation unit for options parsing.

As I need to add and change options quite frequently, how can I automatically reflect these changes by only commenting the code ?

In other words, I have to ship a human readable options table and I want to update it every time I change something in the code.

Foi útil?

Solução

Any doxygen command you add in the body of the text shows up in the details of the function, so if all your options are defined in one function that's pretty simple. If they are scattered about, then use xrefitem and alias to create a new page for your options.

http://www.doxygen.nl/manual/commands.html#cmdxrefitem

In config:

ALIASES += "option=\xrefitem options \"Option\" \"Options\"" 

In code:

/// \option Option -b makes it build

Then in the doxygen output you'll have an Options page that will list all your options. It will need cleaning up before being pasted into user documentation though, as it will include information about where in the code the note was made.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top