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 |
5307
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301, USA. |
796
|
19 |
3449
|
20 ## -*- texinfo -*- |
|
21 ## @deftypefn {Function File} {} bug_report () |
2311
|
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. |
3449
|
25 ## @end deftypefn |
796
|
26 |
2314
|
27 ## Author: jwe |
|
28 |
2311
|
29 function bug_report () |
796
|
30 |
|
31 if (nargin != 0) |
904
|
32 warning ("bug_report: ignoring extra arguments"); |
796
|
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 |
2458
|
41 unwind_protect |
796
|
42 |
2458
|
43 prefs = tmpnam (); |
800
|
44 |
2458
|
45 if (! isempty (prefs)) |
2993
|
46 fid = fopen (prefs, "w"); |
|
47 if (fid > 0) |
|
48 dump_prefs (fid); |
|
49 fclose (fid); |
|
50 endif |
2458
|
51 endif |
796
|
52 |
4011
|
53 cmd = strcat ("octave-bug-", OCTAVE_VERSION); |
800
|
54 |
2458
|
55 if (length (subject) > 0) |
2832
|
56 cmd = sprintf ("%s -s \"%s\"", cmd, subject); |
2458
|
57 endif |
|
58 |
|
59 if (! isempty (prefs)) |
4469
|
60 cmd = sprintf ("%s \"%s\"", cmd, prefs); |
2458
|
61 endif |
800
|
62 |
2458
|
63 system (cmd); |
|
64 |
|
65 unwind_protect_cleanup |
800
|
66 |
2458
|
67 if (! isempty (prefs)) |
|
68 unlink (prefs); |
|
69 endif |
800
|
70 |
2458
|
71 end_unwind_protect |
802
|
72 |
796
|
73 endfunction |