home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21fb.zip / octave / SCRIPTS.ZIP / scripts / miscellaneous / bug_report.m < prev    next >
Text File  |  1999-12-24  |  2KB  |  74 lines

  1. ## Copyright (C) 1996, 1997 John W. Eaton
  2. ##
  3. ## This file is part of Octave.
  4. ##
  5. ## Octave is free software; you can redistribute it and/or modify it
  6. ## under the terms of the GNU General Public License as published by
  7. ## the Free Software Foundation; either version 2, or (at your option)
  8. ## any later version.
  9. ##
  10. ## Octave is distributed in the hope that it will be useful, but
  11. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. ## General Public License for more details.
  14. ##
  15. ## You should have received a copy of the GNU General Public License
  16. ## along with Octave; see the file COPYING.  If not, write to the Free
  17. ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  18. ## 02111-1307, USA.
  19.  
  20. ## usage: bug_report
  21. ##
  22. ## Have Octave create a bug report template file, invoke your favorite
  23. ## editor, and submit the report to the bug-octave mailing list when
  24. ## you are finished editing.
  25.  
  26. ## Author: jwe
  27. ## Modified by Klaus Gebhardt, 1997
  28.  
  29. function bug_report ()
  30.  
  31.   if (nargin != 0)
  32.     warning ("bug_report: ignoring extra arguments");
  33.   endif
  34.  
  35.   printf ("Please enter a one-line description of your bug report.\n\n");
  36.   fflush (stdout);
  37.  
  38.   subject = "";
  39.   subject = input ("Subject: ", "s");
  40.  
  41.   unwind_protect
  42.  
  43.     prefs = tmpnam ();
  44.  
  45.     if (! isempty (prefs))
  46.       fid = fopen (prefs, "w");
  47.       if (fid > 0)
  48.         dump_prefs (fid);
  49.         fclose (fid);
  50.       endif
  51.     endif
  52.  
  53.     cmd = "/octave-bug";
  54.  
  55.     if (length (subject) > 0)
  56.       cmd = sprintf ("%s -s \"%s\"", cmd, subject);
  57.     endif
  58.  
  59.     if (! isempty (prefs))
  60.       cmd = sprintf ("%s %s", cmd, prefs);
  61.     endif
  62.  
  63.     system (cmd);
  64.  
  65.   unwind_protect_cleanup
  66.  
  67.     if (! isempty (prefs))
  68.       unlink (prefs);
  69.     endif
  70.  
  71.   end_unwind_protect
  72.  
  73. endfunction
  74.