2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
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. |
796
|
19 |
2311
|
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. |
796
|
25 |
2314
|
26 ## Author: jwe |
|
27 |
2311
|
28 function bug_report () |
796
|
29 |
|
30 if (nargin != 0) |
904
|
31 warning ("bug_report: ignoring extra arguments"); |
796
|
32 endif |
|
33 |
|
34 printf ("Please enter a one-line description of your bug report.\n\n"); |
|
35 fflush (stdout); |
|
36 |
|
37 subject = ""; |
|
38 subject = input ("Subject: ", "s"); |
|
39 |
2458
|
40 unwind_protect |
796
|
41 |
2458
|
42 prefs = tmpnam (); |
800
|
43 |
2458
|
44 if (! isempty (prefs)) |
|
45 fopen (prefs, "w"); |
|
46 dump_prefs (prefs); |
|
47 fclose (prefs); |
|
48 endif |
796
|
49 |
2832
|
50 cmd = strcat (OCTAVE_HOME, "/bin/octave-bug"); |
800
|
51 |
2458
|
52 if (length (subject) > 0) |
2832
|
53 cmd = sprintf ("%s -s \"%s\"", cmd, subject); |
2458
|
54 endif |
|
55 |
|
56 if (! isempty (prefs)) |
|
57 cmd = sprintf ("%s %s", cmd, prefs); |
|
58 endif |
800
|
59 |
2458
|
60 system (cmd); |
|
61 |
|
62 unwind_protect_cleanup |
800
|
63 |
2458
|
64 if (! isempty (prefs)) |
|
65 unlink (prefs); |
|
66 endif |
800
|
67 |
2458
|
68 end_unwind_protect |
802
|
69 |
796
|
70 endfunction |