Mercurial > hg > octave-nkf
comparison scripts/help/gen_doc_cache.m @ 14552:86854d032a37
maint: miscellaneous style fixes for .m files
* audio/mu2lin.m, deprecated/cut.m, general/cplxpair.m,
general/genvarname.m, geometry/rectint.m, help/gen_doc_cache.m,
image/hsv2rgb.m, image/rainbow.m, io/textscan.m,
miscellaneous/bzip2.m, miscellaneous/compare_versions.m,
miscellaneous/fact.m, miscellaneous/menu.m, optimization/fminbnd.m,
optimization/fminunc.m, optimization/fzero.m, optimization/sqp.m,
plot/__gnuplot_drawnow__.m, plot/axis.m, plot/findobj.m,
plot/legend.m, plot/peaks.m, plot/private/__errplot__.m,
plot/private/__fltk_print__.m, plot/private/__go_draw_axes__.m,
plot/private/__patch__.m, polynomial/pchip.m, polynomial/residue.m,
signal/periodogram.m, sparse/sprandsym.m, statistics/base/moment.m,
statistics/distributions/expcdf.m, statistics/distributions/expinv.m,
statistics/distributions/exppdf.m, statistics/tests/prop_test_2.m,
statistics/tests/sign_test.m, statistics/tests/t_test.m,
statistics/tests/t_test_2.m, statistics/tests/t_test_regression.m,
strings/regexptranslate.m, time/datetick.m:
Style fixes.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 11 Apr 2012 22:07:00 -0400 |
parents | 6bed5141fdad |
children | 1de4ec2a856d |
comparison
equal
deleted
inserted
replaced
14551:60ed9260399a | 14552:86854d032a37 |
---|---|
32 ## @end deftypefn | 32 ## @end deftypefn |
33 | 33 |
34 function gen_doc_cache (out_file = "doc-cache", directory = []) | 34 function gen_doc_cache (out_file = "doc-cache", directory = []) |
35 | 35 |
36 ## Check input | 36 ## Check input |
37 if (!ischar (out_file)) | 37 if (! ischar (out_file)) |
38 print_usage (); | 38 print_usage (); |
39 endif | 39 endif |
40 | 40 |
41 ## Generate cache | 41 ## Generate cache |
42 if (isempty (directory)) | 42 if (isempty (directory)) |
43 cache = gen_builtin_cache (); | 43 cache = gen_builtin_cache (); |
44 elseif (iscell (directory)) | 44 elseif (iscell (directory)) |
45 if all(cellfun (@ischar, directory)) | 45 if (all (cellfun (@ischar, directory))) |
46 cache = gen_doc_cache_in_dir (directory); | 46 cache = gen_doc_cache_in_dir (directory); |
47 else | 47 else |
48 error ("gen_doc_cache: cell must contain only strings"); | 48 error ("gen_doc_cache: cell must contain only strings"); |
49 end | 49 endif |
50 elseif (ischar (directory)) | 50 elseif (ischar (directory)) |
51 cache = gen_doc_cache_in_dir (directory); | 51 cache = gen_doc_cache_in_dir (directory); |
52 else | 52 else |
53 error ("gen_doc_cache: second input argument must be a string or a cell of strings"); | 53 error ("gen_doc_cache: second input argument must be a string or a cell of strings"); |
54 endif | 54 endif |
118 | 118 |
119 ## If 'directory' is not in the current path, add it so we search it | 119 ## If 'directory' is not in the current path, add it so we search it |
120 dir_in_path = ismember (directory, strsplit (path (), pathsep ())); | 120 dir_in_path = ismember (directory, strsplit (path (), pathsep ())); |
121 | 121 |
122 # dirs not in path | 122 # dirs not in path |
123 if !iscell (directory) | 123 if (! iscell (directory)) |
124 directory = {directory}; | 124 directory = {directory}; |
125 end | 125 endif |
126 dirs_notpath = {directory{!dir_in_path}}; | 126 dirs_notpath = {directory{!dir_in_path}}; |
127 | 127 |
128 # add them | 128 # add them |
129 if !isempty (dirs_notpath) | 129 if (! isempty (dirs_notpath)) |
130 cellfun (@addpath, dirs_notpath); | 130 cellfun (@addpath, dirs_notpath); |
131 end | 131 endif |
132 | 132 |
133 # create cache | 133 # create cache |
134 func = @(s_) create_cache (__list_functions__ (s_)); | 134 func = @(s_) create_cache (__list_functions__ (s_)); |
135 cache = cellfun (func, directory, 'UniformOutput', false); | 135 cache = cellfun (func, directory, 'UniformOutput', false); |
136 | 136 |
137 # concatenate results | 137 # concatenate results |
138 cache = [cache{:}]; | 138 cache = [cache{:}]; |
139 | 139 |
140 #remove dirs form path | 140 #remove dirs form path |
141 if !isempty (dirs_notpath) | 141 if (! isempty (dirs_notpath)) |
142 cellfun (@rmpath, dirs_notpath); | 142 cellfun (@rmpath, dirs_notpath); |
143 end | 143 endif |
144 | 144 |
145 endfunction | 145 endfunction |
146 | 146 |
147 function cache = gen_builtin_cache () | 147 function cache = gen_builtin_cache () |
148 operators = __operators__ (); | 148 operators = __operators__ (); |