2 # Source: https://github.com/Anvil/bash-doxygen
 
    6         s/\(@fn [^(]*\)(\(.*\))\(.*\)\(@param \)\([^ \n]\+\(\.\.\.\)\?\)\([^\n]*\)$/\1(\2, \5)\3\4\5\7/
 
    8     /[a-zA-Z0-9_]\+() {$/!{
 
   12     s/\(@fn[^(]\+\)(, /\1(/
 
   13     s/\(@fn \([^(]\+\)(\)\([^)]*\)\().*\)\n\2() {/\1\3\4\n\2(\3) { }/
 
   14     s/\(^\|\n\)## /\1\/\/! /g
 
   18     # The principle is quite easy. For every declare option, we add a
 
   19     # keyword into the sed exchange buffer. Once everything is parsed,
 
   20     # we add the variable identifier and maybe the variable default
 
   21     # value, add that to the exchange buffer and print the result.
 
   23     # Reset exchange buffer
 
   27     # Remove declare keyword, we wont need it anymore
 
   29     # Simple declaration case.
 
   36     # Concat options. Some of them are ignored, such as -f.
 
   38     s/^-\([aAilrtux]\+\) \+-\([aAilrtux]\+\) \+/-\1\2 /
 
   41     # Prepend Exported and ReadOnly attributes
 
   53     # Integer type, exclusive with default 'String' type.
 
   61     # String type. handling.
 
   77     # For arrays, we remove the initialisation since I dont know yet
 
   78     # how to print it for doxygen to understand.
 
   87         s/.*/&AssociativeArray /
 
   93     # Remove the declare option, x, then G will concat the exchange
 
   94     # buffer (the 'type' string) and the regular buffer (the var
 
   95     # possibly followed by an init value). The rest is quite easy to
 
  108 # For arrays, to avoid duplication.
 
  110 s/\(-[^ ]\+ \+[^=]\+\)=.*/\1/
 
  114 # Make all ## lines doxygen-able.