On Fri, 14 Jun 2013 01:18:05 +0000
ow...@bugs.debian.org (Debian Bug Tracking System) wrote:

> For instance there are too many tricky situations that make it
> difficult to return "correct" exit code if user changed her/his mind
> and decided not to save the document or to save it to another file or
> even change file format on save... What error code to return if empty
> file with no data was saved (is it error or not)?

Doesn't seem difficult.  Let's work backwards...

1) An empty spreadsheet file with "no data" cannot be simpler.

Consider the minimal invocation:

        % gnumeric

Gnumeric then creates a blank spreadsheet, and even offers a name, "Book1".  
Suppose the User then presses <Ctrl-S>, <Enter>, and <Ctrl-Q>.  The result
is a new file:

        % ls -log Book1.gnumeric 
        -rw-r--r-- 1 1704 Jun 26 03:36 Book1.gnumeric

Note how it's 1704 bytes.  Those 1704 bytes comprise a correctly
formatted blank spreadsheet.  Rather like a printed paper & ink form,
not yet filled out by a human.

Now suppose this bug was fixed as I'd prefer:

        % gnumeric foo.gnumeric

Followed, (same as before), by the User pressing <Ctrl-S>, <Enter>, and
<Ctrl-Q>.  Which we suppose to produce this:

        % ls -log foo.gnumeric 
        -rw-r--r-- 1 1704 Jun 26 03:48 foo.gnumeric

No need for an error code.


2) User changes format to '.ods'.  Same as before but:

        % ls -log Book1.ods foo.ods
        -rw-r--r-- 1 5209 Jun 26 03:55 Book1.ods
        -rw-r--r-- 1 5209 Jun 26 03:55 foo.ods

No need for an error code for either file.


3)  Save to another filename, i.e. "File>Save As":

        % ls -log bar.gnumeric 
        -rw-r--r-- 1 1704 Jun 26 03:48 bar.gnumeric     

No need for an error code.


4) User quits without saving.  Same as when the user doesn't save "Book1".
No need for an error code.
 

Summing up, to fix this bug, just parse the command line, and if there's a
nonexistent file name 'foo', rename the current default of 'Book1' to 'foo'.


If you agree, (and have no further difficulties in mind), please kindly
reopen this bug.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to