octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: save options handling


From: David Bateman
Subject: Re: save options handling
Date: Fri, 29 Apr 2005 18:02:34 +0200
User-agent: Mozilla Thunderbird 0.8 (X11/20040923)

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                                address@hidden
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

*** 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
  
- "@item -nozip\n\
- @itemx -nz\n\
- Disable the use of the file compression."
- 
- HAVE_ZLIB_HELP_STRING
- 
  "@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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]