3
# Copyright (C) 1999-2012 John W. Eaton
5
# This file is part of Octave.
7
# Octave is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by the
9
# Free Software Foundation; either version 3 of the License, or (at
10
# your option) any later version.
12
# Octave is distributed in the hope that it will be useful, but WITHOUT
13
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17
# You should have received a copy of the GNU General Public License
18
# along with Octave; see the file COPYING. If not, see
19
# <http://www.gnu.org/licenses/>.
21
## Expecting arguments in this order:
23
## SRCDIR SRCDIR-FILES ... -- LOCAL-FILES ...
32
if test -f gethelp; then
36
### This file is generated automatically from the Octave sources.
37
### Edit those files instead and run make to update this file.
42
if [ "$arg" = "--" ]; then
46
unless (@ARGV == 2) { die "Usage: $0 srcdir m_filename" ; }
47
($srcdir, $m_fname) = ($ARGV[0], $ARGV[1]);
48
$full_fname = $srcdir . $m_fname;
49
exit unless ( $full_fname =~ m{(.*)/(@|)([^/]*)/(.*)\.m} );
55
$re_srcdir = quotemeta($srcdir);
56
for (qx{ ./gethelp $fcn "$full_fname" < "$full_fname"} ) {
57
s/^\s+\@/\@/ unless $in_example;
58
s/^\s+\@group/\@group/;
59
s/^\s+\@end\s+group/\@end group/;
60
s|\@c $fcn $re_srcdir|\@c $fcn scripts/|o;
61
$in_example = (/\s*\@example\b/ .. /\s*\@end\s+example\b/);
67
echo "gethelp program seems to be missing!" 1>&2