GithubHelp home page GithubHelp logo

anvil / bash-doxygen Goto Github PK

View Code? Open in Web Editor NEW
90.0 8.0 24.0 21 KB

A doxygen filter for bash scripts

License: Do What The F*ck You Want To Public License

Shell 22.62% sed 77.38%
doxygen doxygen-filter sed bash

bash-doxygen's Issues

Add support for function body prototypes

I want to use intendend @var statements inside my function bodies. If I managed to understand the sed rules correctly, bash-doxygen ignores everything that is intended. If this is the case, it would be great to also pass this info to doxygen.

warning: documented symbol ... was not declared or defined.

#!/bin/bash

## @file      test.sh
## @brief     Simple demo to for debug of bash-doxygen issue
## @author    Eric Butters
## @date      2018-02-07
## @copyright CLOSED
## @details   none

## @fn abc
## @brief echo ABC
function abc() {
   echo "ABC"
}

## @fn def
## @brief echo DEF
function def() {
   echo "DEF"
}

abc
def


# THIS WILL RESULT IN WARNINGS AND NOT CORRECT DOCUMENTATION
# test.sh:10: warning: documented symbol `abc' was not declared or defined.
# test.sh:16: warning: documented symbol `abc' was not declared or defined.

Does not work on fedora 21.

Fedora 21 provides doxygen-1.8.9.1-2.fc21.x86_64 and bash-argsparse package actually have no documentation in it.

It means either the filter does not work with new doxygen, or that doxygen configuration needs to be additionnally tweaked to make it work. So I need to fix either the code or a documentation.

Functions not detected OSX El Cap (probably BSDs as well)

Tested on OSX 10.11.6.

Functions are not detected correctly on Mac OSX. This is because OSX uses BSD sed. This will probably affect BSD OSes also, considering this. To reproduce, just run the unit test on a mac.

The workaround I have found is to install gnu-sed via homebrew, then use gsed instead of sed in Doxyfile.

Not sure if you want to support both versions of sed, but it might be helpful to others to make note of this workaround in the README.

Detect functions

Hi.
Great sed job :-)
Anyway, the detection of functions is inconsistent...

bash allows following function definitions:
: funcname() {
: function funcname() {
: function namespace::funcname() {

Is it possible to reflect this in the script?

Build call graph

Hi.

Is there a way to detect function calls in order to build the call graph ?

Can we get Doxygen to complain about undocumented files and methods?

I'd like to have Doxygen complain about undocumented functions. I have the relevant options set in my Doxyfile.

However, the sed script does not generate anything for functions without a @fn directive. So, undocumented functions are completely hidden with no warning.

Could you please add some support for this?

Question about bash function return values

I think that there are two types of return values of shell functions: the exit code and the standard output. The exit code of a function can be checked for errors and the standard output is usually used as values(call by ref).

if number_of_procs=$(nproc); then
# do something with number_of_procs
else
# handle error
fi

Now, let's say nproc is a shell function rather than the binary. How would you document \retval(the standard output - number of threads) and \exitcode(0 on success, 1 on error)?

Trying Doxygen on MacOS with the example provided

Hi, I tried to run doxygen for bash on the example provided but the html generated is empty, I am using GNU Sed.

Attached all the below files:

  1. Doxygen output from the console
  2. Doxyfile
  3. Example file : ex.sh
  4. Output html folder

Archive.zip

Cumulus-AT1176:~ ahmed$ /usr/local/bin/sed --version
/usr/local/bin/sed (GNU sed) 4.5
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
and Paolo Bonzini.
GNU sed home page: https://www.gnu.org/software/sed/.
General help using GNU software: https://www.gnu.org/gethelp/.
E-mail bug reports to: [email protected].
Cumulus-AT1176:~ ahmed$ uname -a
Darwin Cumulus-AT1176 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64

Warning arguments not present

test.sh:20: warning: argument 'delimiter' of command @param is not found in the argument list of hello(delimiter)
test.sh:8: warning: argument 'string' of command @param is not found in the argument list of simple_function(string, delimiter)
test.sh:8: warning: argument 'delimiter' of command @param is not found in the argument list of simple_function(string, delimiter)

Since .sh files are based on the C oxygen parser, this error seems logic, but I was wondering if we could prevent it.

Combine bash documentation with c++ documentation

I want to combine your nice script in doxygen with my C++ documentation. When I add sed -n -f /path/to/doxygen-bash.sed -- to INPUT_FILTER, it is not showing my CPP classes anymore, but only 'Files'. What to add there so I still have my classes documented?

Use \syntax instead of @syntax

I was wondering if this was possible to use the regular Doxygen syntax with backslashes (e.g. commands like \brief) instead of the syntax with @ annotations?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.