From: R. B. <ro...@pa...> - 2006-08-02 16:57:02
|
All the changes you propose look good and make sense. Go for it! Only thing I ask is to update the bashdb sources so that they aren't left broken :-) (It would be a pity if the thing, bashdb, this was initially written for and probably the only use of it were broken by improving it.) As for a callback, I think that was to allow for the progress bars you had added. A callback seems generally useful and doesn't seem to signficantly slow down the program so why remove it? Masatake YAMATO writes: > > As for readarray, sure, I think reading in a file into an array > > quickly is a generally useful thing. Python has a fancier module > > called linecache. Volunteers for sheparding this through? > > Before, contacting to Chet Ramey, I'd like to have some discussions. > > 1. How do you think rename readarray to readfile? > > I think the shell script writer may be confused read -a and readarray. > readfile is more specific name. > > 2. I think it is better to make readarray options are similar to read. > > char *readarray_doc[] = { > "Copy the lines from the input file into an array variable.", > "Use the `-n' option to specify a count of the number of lines to copy.", > "If -n is missing all lines are copied.", > "Use the `-O' option to specify an index orgin to start the array.", > "If -O is missing the origin will be 0.", > "Use -t to chop trailing newlines (\\n) from lines.", > "To read from stdin use '-' as the filename.", > In stead of specifying filename, how do you think fd like > "read -u fd"? You can slow away `-'. > > 3. Do you think callback is needed? > > readarray is fast enough, so I think callback arguments is > overkilling. I tried more than 10000 lines configure. However, > it takes no time to read. > > Masatake > |