comparison scripts/help/lookfor.m @ 21634:96518f623c91

Backed out changeset dcf8922b724b
author Mike Miller <mtmiller@octave.org>
date Wed, 20 Apr 2016 11:06:03 -0700
parents dcf8922b724b
children ffad2baa90f7
comparison
equal deleted inserted replaced
21633:dcf8922b724b 21634:96518f623c91
162 desc_width = term_width - indent - 2; 162 desc_width = term_width - indent - 2;
163 indent_space = blanks (indent); 163 indent_space = blanks (indent);
164 for k = 1:length (fcnlist) 164 for k = 1:length (fcnlist)
165 f = fcnlist{k}; 165 f = fcnlist{k};
166 f(end+1:indent-1) = " "; 166 f(end+1:indent-1) = " ";
167 fputs ([f " "]); 167 puts ([f " "]);
168 lf = length (f); 168 lf = length (f);
169 desc = strtrim (strrep (help_text{k}, "\n", " ")); 169 desc = strtrim (strrep (help_text{k}, "\n", " "));
170 ldesc = length (desc); 170 ldesc = length (desc);
171 fprintf ("%s\n", desc(1:min (ldesc, desc_width - (lf - indent)))); 171 printf ("%s\n", desc(1:min (ldesc, desc_width - (lf - indent))));
172 for start = (desc_width - (lf - indent) + 1):desc_width:ldesc 172 for start = (desc_width - (lf - indent) + 1):desc_width:ldesc
173 stop = min (start + desc_width, ldesc); 173 stop = min (start + desc_width, ldesc);
174 fprintf ("%s%s\n", indent_space, strtrim (desc (start:stop))); 174 printf ("%s%s\n", indent_space, strtrim (desc (start:stop)));
175 endfor 175 endfor
176 endfor 176 endfor
177 else 177 else
178 ## Return the results instead of displaying them 178 ## Return the results instead of displaying them
179 fcn = fcnlist; 179 fcn = fcnlist;
192 help_texts = cache(3, cache_idx); 192 help_texts = cache(3, cache_idx);
193 else 193 else
194 fcns = help_texts = {}; 194 fcns = help_texts = {};
195 endif 195 endif
196 endfunction 196 endfunction
197