From maintainers-request at octave dot org Fri Apr 29 11:04:47 2005 Subject: Re: save options handling From: David Bateman To: "John W. Eaton" Cc: Bill Denney , octave maintainers mailing list Date: Fri, 29 Apr 2005 18:02:34 +0200 This is a multi-part message in MIME format. --------------050407090409070808040109 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit John W. Eaton wrote: >On 29-Apr-2005, Bill Denney wrote: > >| As someone who is more of a user, I'd think that if I give any options >| they would override the defaults, and it would be hard for me to debug if >| there were other default options that took effect when I gave options. If >| you keep the default options when specific options are used, it would be >| helpful to at least give a warning that the other options were used. > >I agree, I think that if options are supplied, the default options >should not be used. Otherwise, I think we will have a lot of confused >users wondering why their files are compressed when they just >specified "-ascii". > >jwe > > > John, See as you want the code in this manner, I propose the attached patch against the CVS, to implement the compromise I discussed, where if the user supplies a file format the default options are invalidated.. D. -- David Bateman David dot Bateman at motorola dot com Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax) 91193 Gif-Sur-Yvette FRANCE The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary --------------050407090409070808040109 Content-Type: text/plain; name="patch.load-save" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.load-save" *** load-save.cc.old 2005-04-29 17:59:02.833501964 +0200 --- load-save.cc 2005-04-29 17:59:52.015277446 +0200 *************** *** 1151,1160 **** { use_zlib = true; } - else if (argv[i] == "-nozip" || argv[i] == "-nz") - { - use_zlib = false; - } #endif else break; --- 1151,1156 ---- *************** *** 1515,1526 **** HAVE_ZLIB_HELP_STRING - " at item -nozip\n\ - at itemx -nz\n\ - Disable the use of the file compression." - - HAVE_ZLIB_HELP_STRING - " at end table\n\ \n\ The list of variables to save may include wildcard patterns containing\n\ --- 1511,1516 ---- *************** *** 1580,1590 **** bool use_zlib = false; ! parse_save_options (Vdefault_save_options, format, append, save_as_floats, ! save_builtins, use_zlib, 0); ! int i = parse_save_options (argv, argc, format, append, save_as_floats, ! save_builtins, use_zlib, 1); if (error_state) return retval; --- 1570,1588 ---- bool use_zlib = false; ! load_save_format user_file_format = LS_UNKNOWN; ! bool dummy; ! ! // Get user file format ! parse_save_options (argv, argc, user_file_format, dummy, ! dummy, dummy, dummy, 1); ! ! if (user_file_format == LS_UNKNOWN) ! parse_save_options (Vdefault_save_options, format, append, save_as_floats, ! save_builtins, use_zlib, 0); ! int i = parse_save_options (argv, argc, format, append, save_as_floats, ! save_builtins, use_zlib, 1); if (error_state) return retval; --------------050407090409070808040109--